From 05c2749760c233c43745aeb55ffc914232a91ad0 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Wed, 21 Sep 2011 21:26:34 +0200 Subject: [PATCH] Joysticks are supposed to be 1-indexed, even in the callbacks.. --- src/modules/event/sdl/wrap_Event.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/event/sdl/wrap_Event.cpp b/src/modules/event/sdl/wrap_Event.cpp index 8a519b780..a7f93a40e 100644 --- a/src/modules/event/sdl/wrap_Event.cpp +++ b/src/modules/event/sdl/wrap_Event.cpp @@ -108,8 +108,8 @@ namespace sdl return 4; case Event::TYPE_JOYSTICK_PRESSED: case Event::TYPE_JOYSTICK_RELEASED: - lua_pushinteger(L, msg.joystick.index); - lua_pushinteger(L, msg.joystick.button); + lua_pushinteger(L, msg.joystick.index+1); + lua_pushinteger(L, msg.joystick.button+1); return 3; case Event::TYPE_FOCUS: lua_pushboolean(L, msg.focus.f);