Page 1 of 1

[0.9.7] game.gettile() one tile off in negative side of axes

Posted: Mon Apr 07, 2014 3:54 pm
by rk84
Example

Code: Select all

game.gettile(-10.5,-10.5).name -- returns name of tile in -9.5, -9.5
Test value range of .0-.9 gives same results.

Edit: fixed positive -> negative.
Edit2: Workaround

Code: Select all

function getTile(position)
  local x = (position.x < 0) and -1 or 0
  local y = (position.y < 0) and -1 or 0
  return game.gettile(position.x + x, position.y + y)
end

Re: [0.9.7] game.gettile() one tile off in negative side of

Posted: Fri Apr 11, 2014 8:36 am
by kovarex
Thank you for the notice, it is fixed for 0.9.8 now.