l_event cleanup;

This commit is contained in:
bjorn 2020-10-26 02:30:56 -06:00
parent e533adf649
commit 276faf30ad
1 changed files with 3 additions and 8 deletions

View File

@ -270,19 +270,14 @@ static int l_lovrEventPush(lua_State* L) {
}
static int l_lovrEventQuit(lua_State* L) {
EventData data;
data.quit.exitCode = luaL_optinteger(L, 1, 0);
EventType type = EVENT_QUIT;
Event event = { .type = type, .data = data };
int exitCode = luaL_optinteger(L, 1, 0);
Event event = { .type = EVENT_QUIT, .data.quit.exitCode = status };
lovrEventPush(event);
return 0;
}
static int l_lovrEventRestart(lua_State* L) {
EventType type = EVENT_RESTART;
Event event = { .type = type };
Event event = { .type = EVENT_RESTART };
lovrEventPush(event);
return 0;
}