From db1e8e762a45cedab175eaa74e1ab87c984408b5 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 26 Aug 2013 13:27:19 -0300 Subject: [PATCH] Joystick:getIndex now returns nil instead of -1 if the joystick isn't connected --- src/modules/joystick/sdl/wrap_JoystickModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/joystick/sdl/wrap_JoystickModule.cpp b/src/modules/joystick/sdl/wrap_JoystickModule.cpp index 3a3769e40..99c6454f3 100644 --- a/src/modules/joystick/sdl/wrap_JoystickModule.cpp +++ b/src/modules/joystick/sdl/wrap_JoystickModule.cpp @@ -51,7 +51,7 @@ int w_getIndex(lua_State *L) if (index >= 0) lua_pushinteger(L, index + 1); else - lua_pushinteger(L, -1); + lua_pushnil(L); return 1; }