Fix dead people standing up after being stunned (#3330)

* fix crit/dead players standing up

* actually fix crit/dead players standing up

* nullable + missed check

Co-authored-by: cyclowns <cyclowns@protonmail.ch>
This commit is contained in:
mirrorcult
2021-02-20 15:55:35 -07:00
committed by GitHub
parent f85d8435c1
commit 6c088c36b8
4 changed files with 26 additions and 16 deletions

View File

@@ -353,13 +353,16 @@ namespace Content.Server.GameObjects.Components.Instruments
UserInterface?.CloseAll();
if(Handheld)
EntitySystem.Get<StandingStateSystem>().DropAllItemsInHands(mob, false);
if (mob != null && mob.TryGetComponent(out StunnableComponent? stun))
if (mob != null)
{
stun.Stun(1);
Clean();
if (Handheld)
EntitySystem.Get<StandingStateSystem>().DropAllItemsInHands(mob, false);
if (mob.TryGetComponent(out StunnableComponent? stun))
{
stun.Stun(1);
Clean();
}
}
InstrumentPlayer = null;