inconsistent indexing: joystickpressed/Joystick.isDown

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
wilbefast
Prole
Posts: 4
Joined: Sat Dec 28, 2013 3:19 am

inconsistent indexing: joystickpressed/Joystick.isDown

Post 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
User avatar
slime
Solid Snayke
Posts: 3177
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: inconsistent indexing: joystickpressed/Joystick.isDown

Post 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.
wilbefast
Prole
Posts: 4
Joined: Sat Dec 28, 2013 3:19 am

Re: inconsistent indexing: joystickpressed/Joystick.isDown

Post by wilbefast »

Oh... sorry, I seemed to have missed that somehow :?
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 7 guests