Преглед на файлове

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

Alex Szpakowski преди 12 години
родител
ревизия
db1e8e762a
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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;
 }