Moving when dead ghosts you
This commit is contained in:
@@ -3,12 +3,14 @@ using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.Components.Movement;
|
||||
using Content.Server.GameObjects.Components.Sound;
|
||||
using Content.Server.Interfaces.GameObjects.Components.Movement;
|
||||
using Content.Server.Observer;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.GameObjects.Components.Inventory;
|
||||
using Content.Shared.Maps;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Server.Interfaces.Timing;
|
||||
using Robust.Shared.Configuration;
|
||||
@@ -25,6 +27,7 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
@@ -138,6 +141,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
if (physics.LinearVelocity != Vector2.Zero)
|
||||
physics.LinearVelocity = Vector2.Zero;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -185,6 +189,11 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
if (!TryGetAttachedComponent(session as IPlayerSession, out IMoverComponent moverComp))
|
||||
return;
|
||||
|
||||
var owner = (session as IPlayerSession)?.AttachedEntity;
|
||||
|
||||
if (owner != null && owner.TryGetComponent(out SpeciesComponent species) && species.CurrentDamageState is DeadState)
|
||||
new Ghost().Execute(null, (IPlayerSession)session, null);
|
||||
|
||||
moverComp.SetVelocityDirection(dir, state);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user