new hooks and item removing

This commit is contained in:
Evil Factory
2021-08-09 23:43:38 -03:00
parent 7f0fac3553
commit 64ed424a6b
4 changed files with 74 additions and 1 deletions
@@ -410,7 +410,7 @@ namespace Barotrauma
if (targetLimb == null)
{
#if SERVER
var should = GameMain.Lua.hook.Call("afflictionApplied", new DynValue[] { UserData.Create(this), UserData.Create(affliction) });
var should = GameMain.Lua.hook.Call("afflictionApplied", new DynValue[] { LuaSetup.CreateUserDataSafe(this), LuaSetup.CreateUserDataSafe(affliction) });
if (should != null && should.CastToBool())
{
@@ -526,6 +526,15 @@ namespace Barotrauma
return;
}
#if SERVER
var should = GameMain.Lua.hook.Call("afflictionApplied", new DynValue[] { LuaSetup.CreateUserDataSafe(this), LuaSetup.CreateUserDataSafe(attackResult), LuaSetup.CreateUserDataSafe(hitLimb) });
if (should != null && should.CastToBool())
{
return;
}
#endif
foreach (Affliction newAffliction in attackResult.Afflictions)
{
if (newAffliction.Prefab.LimbSpecific)