- PCALL_RES(lua_pcall(L, 3, 0, error_handler));
- lua_pop(L, 1); // Pop error handler
- return true;
+ PCALL_RES(lua_pcall(L, 3, 1, error_handler));
+
+ // nil is treated as true for backwards compat
+ bool result = lua_isnil(L, -1) || lua_toboolean(L, -1);
+
+ lua_pop(L, 2); // Pop error handler and result
+
+ return result;