mirror of https://github.com/bjornbytes/lovr.git
Restart cookie minor changes for PR review
This commit is contained in:
parent
c32fbdd8fc
commit
b5e72d8bd9
|
@ -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 };
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue