lets hope this doesn't break anything: returned type by hook is now the last hook registered
This commit is contained in:
@@ -596,15 +596,13 @@ namespace Barotrauma
|
|||||||
if (!hookFunctions.ContainsKey(name))
|
if (!hookFunctions.ContainsKey(name))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
object lastResult = null;
|
||||||
|
|
||||||
foreach (HookFunction hf in hookFunctions[name].Values)
|
foreach (HookFunction hf in hookFunctions[name].Values)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result = env.lua.Call(hf.function, args);
|
lastResult = env.lua.Call(hf.function, args);
|
||||||
if (result.IsNil() == false)
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -612,7 +610,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return lastResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user