Fix muzzle flash lights (#17843)
This commit is contained in:
@@ -270,8 +270,9 @@ public sealed partial class GunSystem : SharedGunSystem
|
|||||||
var ent = Spawn(message.Prototype, coordinates);
|
var ent = Spawn(message.Prototype, coordinates);
|
||||||
|
|
||||||
var effectXform = Transform(ent);
|
var effectXform = Transform(ent);
|
||||||
effectXform.LocalRotation -= MathF.PI / 2;
|
TransformSystem.SetLocalPositionRotation(effectXform,
|
||||||
effectXform.LocalPosition += new Vector2(0f, -0.5f);
|
effectXform.LocalPosition + new Vector2(0f, -0.5f),
|
||||||
|
effectXform.LocalRotation - MathF.PI / 2);
|
||||||
|
|
||||||
var lifetime = 0.4f;
|
var lifetime = 0.4f;
|
||||||
|
|
||||||
@@ -301,14 +302,10 @@ public sealed partial class GunSystem : SharedGunSystem
|
|||||||
|
|
||||||
_animPlayer.Play(ent, anim, "muzzle-flash");
|
_animPlayer.Play(ent, anim, "muzzle-flash");
|
||||||
var light = EnsureComp<PointLightComponent>(uid);
|
var light = EnsureComp<PointLightComponent>(uid);
|
||||||
|
|
||||||
if (light.Enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
light.NetSyncEnabled = false;
|
light.NetSyncEnabled = false;
|
||||||
light.Enabled = true;
|
Lights.SetEnabled(uid, true, light);
|
||||||
|
Lights.SetRadius(uid, 2f, light);
|
||||||
light.Color = Color.FromHex("#cc8e2b");
|
light.Color = Color.FromHex("#cc8e2b");
|
||||||
light.Radius = 2f;
|
|
||||||
light.Energy = 5f;
|
light.Energy = 5f;
|
||||||
|
|
||||||
var animTwo = new Animation()
|
var animTwo = new Animation()
|
||||||
|
|||||||
@@ -45,16 +45,17 @@ public abstract partial class SharedGunSystem : EntitySystem
|
|||||||
[Dependency] private readonly RechargeBasicEntityAmmoSystem _recharge = default!;
|
[Dependency] private readonly RechargeBasicEntityAmmoSystem _recharge = default!;
|
||||||
[Dependency] protected readonly SharedActionsSystem Actions = default!;
|
[Dependency] protected readonly SharedActionsSystem Actions = default!;
|
||||||
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
||||||
|
[Dependency] protected readonly SharedAudioSystem Audio = default!;
|
||||||
[Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
|
[Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
|
||||||
[Dependency] protected readonly SharedContainerSystem Containers = default!;
|
[Dependency] protected readonly SharedContainerSystem Containers = default!;
|
||||||
[Dependency] protected readonly SharedPhysicsSystem Physics = default!;
|
|
||||||
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
|
|
||||||
[Dependency] protected readonly ThrowingSystem ThrowingSystem = default!;
|
|
||||||
[Dependency] protected readonly TagSystem TagSystem = default!;
|
|
||||||
[Dependency] protected readonly SharedAudioSystem Audio = default!;
|
|
||||||
[Dependency] private readonly SharedGravitySystem _gravity = default!;
|
[Dependency] private readonly SharedGravitySystem _gravity = default!;
|
||||||
|
[Dependency] protected readonly SharedPointLightSystem Lights = default!;
|
||||||
|
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
|
||||||
|
[Dependency] protected readonly SharedPhysicsSystem Physics = default!;
|
||||||
[Dependency] protected readonly SharedProjectileSystem Projectiles = default!;
|
[Dependency] protected readonly SharedProjectileSystem Projectiles = default!;
|
||||||
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
|
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
|
||||||
|
[Dependency] protected readonly TagSystem TagSystem = default!;
|
||||||
|
[Dependency] protected readonly ThrowingSystem ThrowingSystem = default!;
|
||||||
|
|
||||||
protected ISawmill Sawmill = default!;
|
protected ISawmill Sawmill = default!;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user