Fix muzzle flash lights (#17843)

This commit is contained in:
metalgearsloth
2023-07-06 14:42:38 +10:00
committed by GitHub
parent 876beb9369
commit 619a8e630f
2 changed files with 11 additions and 13 deletions

View File

@@ -270,8 +270,9 @@ public sealed partial class GunSystem : SharedGunSystem
var ent = Spawn(message.Prototype, coordinates);
var effectXform = Transform(ent);
effectXform.LocalRotation -= MathF.PI / 2;
effectXform.LocalPosition += new Vector2(0f, -0.5f);
TransformSystem.SetLocalPositionRotation(effectXform,
effectXform.LocalPosition + new Vector2(0f, -0.5f),
effectXform.LocalRotation - MathF.PI / 2);
var lifetime = 0.4f;
@@ -301,14 +302,10 @@ public sealed partial class GunSystem : SharedGunSystem
_animPlayer.Play(ent, anim, "muzzle-flash");
var light = EnsureComp<PointLightComponent>(uid);
if (light.Enabled)
return;
light.NetSyncEnabled = false;
light.Enabled = true;
Lights.SetEnabled(uid, true, light);
Lights.SetRadius(uid, 2f, light);
light.Color = Color.FromHex("#cc8e2b");
light.Radius = 2f;
light.Energy = 5f;
var animTwo = new Animation()