From 44d87212b787b8ba2e68228cff38e479f982c9ca Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 23 Dec 2013 00:28:03 -0400 Subject: [PATCH] Fixed Joystick:isDown to accept 1-based instead of 0-based button indices --- src/modules/joystick/sdl/wrap_Joystick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/joystick/sdl/wrap_Joystick.cpp b/src/modules/joystick/sdl/wrap_Joystick.cpp index d7ecb0389..db304ce07 100644 --- a/src/modules/joystick/sdl/wrap_Joystick.cpp +++ b/src/modules/joystick/sdl/wrap_Joystick.cpp @@ -135,7 +135,7 @@ int w_Joystick_isDown(lua_State *L) std::vector buttons; for (int i = 2; i <= lua_gettop(L); i++) - buttons.push_back(luaL_checkint(L, i)); + buttons.push_back(luaL_checkint(L, i) - 1); luax_pushboolean(L, j->isDown(buttons)); return 1;