Browse Source

Joystick:getIndex now returns nil instead of -1 if the joystick isn't connected

Alex Szpakowski 12 years ago
parent
commit
db1e8e762a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/joystick/sdl/wrap_JoystickModule.cpp

+ 1 - 1
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;
 }