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

@ -23,6 +23,8 @@ namespace scripting::lua
void handle_error(const sol::protected_function_result& result) void handle_error(const sol::protected_function_result& result)
{ {
if (!result.valid()) if (!result.valid())
{
try
{ {
game_console::print(game_console::con_type_error, "************** Script execution error **************\n"); game_console::print(game_console::con_type_error, "************** Script execution error **************\n");
@ -33,5 +35,9 @@ namespace scripting::lua
notify_error(); notify_error();
} }
catch (...)
{
}
}
} }
} }

View File

@ -43,6 +43,12 @@ namespace scripting::lua
if (!i->is_deleted) 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))); handle_error(i->callback(sol::as_args(arguments)));
} }