NPC refactor (#10122)

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2022-09-06 00:28:23 +10:00
committed by GitHub
parent 138e328c04
commit 0286b88388
290 changed files with 13842 additions and 5939 deletions

View File

@@ -235,8 +235,19 @@ public sealed partial class GunSystem : SharedGunSystem
protected override void CreateEffect(EntityUid uid, MuzzleFlashEvent message, EntityUid? user = null)
{
if (!Timing.IsFirstTimePredicted || !TryComp<TransformComponent>(uid, out var xform)) return;
var ent = Spawn(message.Prototype, xform.Coordinates);
if (!Timing.IsFirstTimePredicted)
return;
EntityCoordinates coordinates;
if (message.MatchRotation)
coordinates = new EntityCoordinates(uid, Vector2.Zero);
else if (TryComp<TransformComponent>(uid, out var xform))
coordinates = xform.Coordinates;
else
return;
var ent = Spawn(message.Prototype, coordinates);
var effectXform = Transform(ent);
effectXform.LocalRotation -= MathF.PI / 2;