Restart cookie minor changes for PR review

This commit is contained in:
mcc 2020-04-16 10:57:13 -04:00
parent c32fbdd8fc
commit b5e72d8bd9
2 changed files with 2 additions and 8 deletions

View File

@ -170,12 +170,7 @@ static int l_lovrEventPush(lua_State* L) {
static int l_lovrEventQuit(lua_State* L) {
EventData data;
int argType = lua_type(L, 1);
if (argType == LUA_TNUMBER || lua_isnoneornil(L, 1)) {
data.quit.exitCode = luaL_optint(L, 1, 0);
} else {
return luaL_argerror (L, 1, "number or nil expected");
}
data.quit.exitCode = luaL_optint(L, 1, 0);
EventType type = EVENT_QUIT;
Event event = { .type = type, .data = data };

View File

@ -152,8 +152,7 @@ function lovr.run()
if name == 'restart' then
local cookie = lovr.restart and lovr.restart()
return 'restart', cookie
end
if name == 'quit' and (not lovr.quit or not lovr.quit(a)) then
elseif name == 'quit' and (not lovr.quit or not lovr.quit(a)) then
return a or 0
end
if lovr.handlers[name] then lovr.handlers[name](a, b, c, d) end