Added code (to finish) for executing LUA triggers

This commit is contained in:
MontyTRC89 2021-07-17 05:56:40 +02:00
parent 223e7b673f
commit 7c1e29e6d0
3 changed files with 16 additions and 3 deletions

View file

@ -427,6 +427,18 @@ void LuaVariables::SetVariable(std::string key, sol::object value)
}
}
void GameScript::ExecuteFunction(std::string name)
{
/*sol::protected_function func = (*m_lua)[name.c_str()];
auto r = func();
if (WarningsAsErrors && !r.valid())
{
sol::error err = r;
std::cerr << "An error occurred: " << err.what() << "\n";
throw std::runtime_error(err.what());
}*/
}
static void doCallback(sol::protected_function const & func) {
auto r = func();
if (WarningsAsErrors && !r.valid())