From 07bd386d4edbd66e554056f814a3aa1a7c553234 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Sat, 10 Mar 2012 14:11:20 +0100 Subject: [PATCH] Apply the 1-indexed joysticks patch from issue #391. Submitted by: Alexander Szpakowski --- src/modules/joystick/sdl/Joystick.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/joystick/sdl/Joystick.cpp b/src/modules/joystick/sdl/Joystick.cpp index 62b246370..9209571c3 100644 --- a/src/modules/joystick/sdl/Joystick.cpp +++ b/src/modules/joystick/sdl/Joystick.cpp @@ -157,7 +157,7 @@ namespace sdl int Joystick::getAxes(lua_State * L) { love::luax_assert_argc(L, 1, 1); - int index = (int)lua_tointeger(L, 1); + int index = (int)lua_tointeger(L, 1) - 1; if (!verifyJoystick(index)) return 0; @@ -172,8 +172,8 @@ namespace sdl int Joystick::getBall(lua_State * L) { love::luax_assert_argc(L, 2, 2); - int index = (int)lua_tointeger(L, 1); - int ball = (int)lua_tointeger(L, 2); + int index = (int)lua_tointeger(L, 1) - 1; + int ball = (int)lua_tointeger(L, 2) - 1; if (!verifyJoystick(index)) return 0;