Page 1 of 1

inconsistent indexing: joystickpressed/Joystick.isDown

Posted: Sat Dec 28, 2013 3:28 am
by wilbefast
I haz found bug :joker:

Migrating my code from 0.8.0 to 0.9.0 it seems that love.joystickpressed is called for indexes starting at 1 while Joystick.isDown expects and index starting from 0. Minimal code:

Code: Select all

function love.joystickpressed(j, b)
  print(j:isDown(b)) -- always false, ie. wtfroflmao?
end

Code: Select all

function love.joystickpressed(j, b)
  print(j:isDown(b-1)) -- always true
end

Re: inconsistent indexing: joystickpressed/Joystick.isDown

Posted: Sat Dec 28, 2013 3:30 am
by slime
Yeah, it slipped through the cracks unfortunately.
But it's already been fixed for the next version (probably 0.9.1), and the wiki documentation for [wiki]Joystick:isDown[/wiki] has a notice about it.

Re: inconsistent indexing: joystickpressed/Joystick.isDown

Posted: Sat Dec 28, 2013 3:32 am
by wilbefast
Oh... sorry, I seemed to have missed that somehow :?