diff --git a/ChaosMod/Components/LuaScripts.cpp b/ChaosMod/Components/LuaScripts.cpp index e435b9b1a..eb3a7534f 100644 --- a/ChaosMod/Components/LuaScripts.cpp +++ b/ChaosMod/Components/LuaScripts.cpp @@ -296,7 +296,6 @@ static const std::vector ms_Exposables { E("GET_HASH_KEY", GET_HASH_KEY), E("print", [](const sol::this_environment &curEnv, const std::string &text) { LuaPrint(curEnv.env->get("EnvInfo")["ScriptName"], text); }), - E("WAIT", WAIT), E("IsKeyPressed", [](unsigned char key) { @@ -466,6 +465,7 @@ LuaScripts::LuaScripts() { return LuaInvoke(curEnv, hash, returnType, args); }; + m_GlobalState["WAIT"] = WAIT; } else { @@ -475,6 +475,10 @@ LuaScripts::LuaScripts() LOG("WARNING: Blocked invocation of native 0x" << std::uppercase << std::hex << hash << std::setfill(' ') << " during script evaluation!"); }; + m_GlobalState["WAIT"] = []() + { + LOG("WARNING: Blocked invocation of WAIT during script evaluation!"); + }; } for (auto dir : ms_ScriptDirs) @@ -506,6 +510,7 @@ LuaScripts::LuaScripts() { return LuaInvoke(curEnv, hash, returnType, args); }; + m_GlobalState["WAIT"] = WAIT; } }