ExecutionNumber variable that counts how many times lua has been executed

This commit is contained in:
Evil Factory
2022-05-19 16:17:21 -03:00
parent 01168bd852
commit 4078fe024b

View File

@@ -39,6 +39,8 @@ namespace Barotrauma
public const bool IsClient = true;
#endif
private static int ExecutionNumber = 0;
private Script lua;
public CsScriptRunner CsScript { get; private set; }
@@ -414,6 +416,8 @@ namespace Barotrauma
lua.Globals["Networking"] = Networking;
lua.Globals["Steam"] = Steam;
lua.Globals["ExecutionNumber"] = ExecutionNumber;
lua.Globals["SERVER"] = IsServer;
lua.Globals["CLIENT"] = IsClient;
@@ -499,6 +503,8 @@ modding needs.
{
PrintError("LuaSetup.lua not found! Lua/LuaSetup.lua, no Lua scripts will be executed or work.");
}
ExecutionNumber++;
}
}