Commits

Bart van Strien committed e7559e4

Apply the 1-indexed joysticks patch from issue #391.

Submitted by: Alexander Szpakowski

  • Participants
  • Parent commits 5eb5a6b

Comments (0)

Files changed (1)

File src/modules/joystick/sdl/Joystick.cpp

 	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;
 	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;