lets hope this doesn't break anything: returned type by hook is now the last hook registered

This commit is contained in:
Evil Factory
2021-09-08 13:05:34 -03:00
parent eb28b3a7f1
commit 01eec1e9ad

View File

@@ -596,15 +596,13 @@ namespace Barotrauma
if (!hookFunctions.ContainsKey(name))
return null;
object lastResult = null;
foreach (HookFunction hf in hookFunctions[name].Values)
{
try
{
var result = env.lua.Call(hf.function, args);
if (result.IsNil() == false)
{
return result;
}
lastResult = env.lua.Call(hf.function, args);
}
catch (Exception e)
{
@@ -612,7 +610,7 @@ namespace Barotrauma
}
}
return null;
return lastResult;
}
}
}