fix error handling in events and runnables
This commit is contained in:
@@ -136,10 +136,12 @@ bool lua::emit_event(
|
||||
getglobal(L, "events");
|
||||
getfield(L, "emit");
|
||||
pushstring(L, name);
|
||||
call_nothrow(L, args(L) + 1);
|
||||
bool result = toboolean(L, -1);
|
||||
pop(L, 2);
|
||||
return result;
|
||||
if (call_nothrow(L, args(L) + 1)) {
|
||||
bool result = toboolean(L, -1);
|
||||
pop(L, 2);
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
State* lua::get_main_state() {
|
||||
|
||||
Reference in New Issue
Block a user