Modify system.wait_event to wait indefinitely if no timeout is given
This commit is contained in:
@@ -133,8 +133,13 @@ top:
|
|||||||
|
|
||||||
|
|
||||||
static int f_wait_event(lua_State *L) {
|
static int f_wait_event(lua_State *L) {
|
||||||
|
int nargs = lua_gettop(L);
|
||||||
|
if (nargs >= 1) {
|
||||||
double n = luaL_checknumber(L, 1);
|
double n = luaL_checknumber(L, 1);
|
||||||
lua_pushboolean(L, SDL_WaitEventTimeout(NULL, n * 1000));
|
lua_pushboolean(L, SDL_WaitEventTimeout(NULL, n * 1000));
|
||||||
|
} else {
|
||||||
|
lua_pushboolean(L, SDL_WaitEvent(NULL));
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user