Hello tablecloth,
You found a bug, and you’re right about the cause as well. I check for the tile’s existence in the other tint functions, but this one slipped under the radar. If you go to line 12295 of main.lua you’ll see the Tint Tiles block:
--Tint tiles for key,value in pairs(tintingTiles) do local tile = tintingTiles[key] tile.currentColor[1] = tile.currentColor[1] - tile.deltaTint[1][1] tile.currentColor[2] = tile.currentColor[2] - tile.deltaTint[2][1] tile.currentColor[3] = tile.currentColor[3] - tile.deltaTint[3][1] for i = 1, 3, 1 do if tile.currentColor[i] \> 1 then tile.currentColor[i] = 1 end if tile.currentColor[i] \< 0 then tile.currentColor[i] = 0 end end tile:setFillColor(tile.currentColor[1], tile.currentColor[2], tile.currentColor[3]) table.remove(tile.deltaTint[1], 1) table.remove(tile.deltaTint[2], 1) table.remove(tile.deltaTint[3], 1) if not tile.deltaTint[1][1] then tile.deltaTint = nil tintingTiles[tile] = nil end end
Replace it with this modified version to correct the problem:
--Tint tiles for key,value in pairs(tintingTiles) do local tile = tintingTiles[key] if tileObjects[tile.layer][tile.locX] and tileObjects[tile.layer][tile.locX][tile.locY] then tile.currentColor[1] = tile.currentColor[1] - tile.deltaTint[1][1] tile.currentColor[2] = tile.currentColor[2] - tile.deltaTint[2][1] tile.currentColor[3] = tile.currentColor[3] - tile.deltaTint[3][1] for i = 1, 3, 1 do if tile.currentColor[i] \> 1 then tile.currentColor[i] = 1 end if tile.currentColor[i] \< 0 then tile.currentColor[i] = 0 end end tile:setFillColor(tile.currentColor[1], tile.currentColor[2], tile.currentColor[3]) table.remove(tile.deltaTint[1], 1) table.remove(tile.deltaTint[2], 1) table.remove(tile.deltaTint[3], 1) if not tile.deltaTint[1][1] then tile.deltaTint = nil tintingTiles[tile] = nil end else tintingTiles[key] = nil end end
I’m not releasing an update this week because I’m in the middle of implementing map stitching, but the fix will be included in the next release.