浏览代码

Changed Joystick:getID to be 1-based instead of 0-based

Alex Szpakowski 12 年之前
父节点
当前提交
75eb34379c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/modules/joystick/sdl/wrap_Joystick.cpp

+ 1 - 1
src/modules/joystick/sdl/wrap_Joystick.cpp

@@ -53,7 +53,7 @@ int w_Joystick_getName(lua_State *L)
 int w_Joystick_getID(lua_State *L)
 {
 	Joystick *j = luax_checkjoystick(L, 1);
-	lua_pushinteger(L, j->getID());
+	lua_pushinteger(L, j->getID() + 1); // IDs are 1-based in Lua.
 	return 1;
 }