Fixed NRE with status effect luahook

This commit is contained in:
EvilFactory
2023-10-19 14:32:17 -03:00
parent 465b800471
commit 3af538bd87
@@ -1565,6 +1565,8 @@ namespace Barotrauma
} }
} }
if (luaHook != null)
{
foreach (string luaHooks in luaHook) foreach (string luaHooks in luaHook)
{ {
var result = GameMain.LuaCs.Hook.Call<bool?>(luaHooks, this, deltaTime, entity, targets, worldPosition); var result = GameMain.LuaCs.Hook.Call<bool?>(luaHooks, this, deltaTime, entity, targets, worldPosition);
@@ -1572,6 +1574,7 @@ namespace Barotrauma
if (result != null && result.Value) if (result != null && result.Value)
return; return;
} }
}
Hull hull = GetHull(entity); Hull hull = GetHull(entity);
Vector2 position = GetPosition(entity, targets, worldPosition); Vector2 position = GetPosition(entity, targets, worldPosition);