Small fix

This commit is contained in:
Federico Cecchetto 2021-08-29 02:19:37 +02:00
parent bbcad907fa
commit 7610758306
2 changed files with 17 additions and 5 deletions

View File

@ -24,14 +24,20 @@ namespace scripting::lua
{
if (!result.valid())
{
game_console::print(game_console::con_type_error, "************** Script execution error **************\n");
try
{
game_console::print(game_console::con_type_error, "************** Script execution error **************\n");
const sol::error err = result;
game_console::print(game_console::con_type_error, "%s\n", err.what());
const sol::error err = result;
game_console::print(game_console::con_type_error, "%s\n", err.what());
game_console::print(game_console::con_type_error, "****************************************************\n");
game_console::print(game_console::con_type_error, "****************************************************\n");
notify_error();
notify_error();
}
catch (...)
{
}
}
}
}

View File

@ -43,6 +43,12 @@ namespace scripting::lua
if (!i->is_deleted)
{
if (!has_built_arguments)
{
has_built_arguments = true;
arguments = this->build_arguments(event);
}
handle_error(i->callback(sol::as_args(arguments)));
}