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

This subforum contains all the issues which we already resolved.
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

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

Post 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
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post by kovarex »

Thank you for the notice, it is fixed for 0.9.8 now.
Post Reply

Return to “Resolved Problems and Bugs”