fix character death

This commit is contained in:
Evil Factory
2021-08-19 16:16:32 -03:00
parent b8fffad6c8
commit 529c1643a8
@@ -3748,10 +3748,6 @@ namespace Barotrauma
GameMain.NetworkMember.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status }); GameMain.NetworkMember.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });
} }
#if SERVER
GameMain.Lua.hook.Call("characterDeath", new MoonSharp.Interpreter.DynValue[] { MoonSharp.Interpreter.UserData.Create(this) });
#endif
isDead = true; isDead = true;
ApplyStatusEffects(ActionType.OnDeath, 1.0f); ApplyStatusEffects(ActionType.OnDeath, 1.0f);
@@ -3813,6 +3809,11 @@ namespace Barotrauma
{ {
GameMain.GameSession.KillCharacter(this); GameMain.GameSession.KillCharacter(this);
} }
#if SERVER
GameMain.Lua.hook.Call("characterDeath", new MoonSharp.Interpreter.DynValue[] { MoonSharp.Interpreter.UserData.Create(this) });
#endif
} }
partial void KillProjSpecific(CauseOfDeathType causeOfDeath, Affliction causeOfDeathAffliction, bool log); partial void KillProjSpecific(CauseOfDeathType causeOfDeath, Affliction causeOfDeathAffliction, bool log);