Look at the below method. There is a for loop for i = 1, #map.layers, 1, do... Follow that loop to its closing block, now drop down to the next if block and it references the i parameter of the for loop, but it is out of scope so throws an error: Line#s in actual file: 1394 (method) 1435 (error) M.getTileAt = function(parameters) local locX = parameters.locX local locY = parameters.locY local layer = parameters.layer if parameters.levelPosX then locX, locY = M.levelToLoc(parameters.levelPosX, parameters.levelPosY) end if not layer then local values = {} for i = 1, #map.layers, 1 do if locX \> map.layers[i].width then if locX \> map.layers[i].width then locX = locX - map.layers[i].width end elseif locX \< 1 then if locX \< 1 then locX = locX + map.layers[i].width end end if locY \> map.layers[i].height then if locY \> map.layers[i].height then locY = locY - map.layers[i].height end elseif locY \< 1 then if locY \< 1 then locY = locY + map.layers[i].height end end values[i] = map.layers[i].world[locX][locY] end return values else if locX \> map.layers[layer].width then if locX \> map.layers[layer].width then locX = locX - map.layers[layer].width end elseif locX \< 1 then if locX \< 1 then locX = locX + map.layers[layer].width end end if locY \> map.layers[i].height then if locY \> map.layers[i].height then locY = locY - map.layers[i].height end elseif locY \< 1 then if locY \< 1 then locY = locY + map.layers[i].height end end return map.layers[layer].world[locX][locY] end end
The fix is just to change the i param to the layer param
Thanks icodemarine! I’ll make the correction on my end. I think I’ll hold off on releasing a new engine file until sometime next week so I can gather any other bug fixes into it. I don’t want to flood people’s inboxes with MTE updates. Let me know if you find anything else!
The fix is just to change the i param to the layer param
Thanks icodemarine! I’ll make the correction on my end. I think I’ll hold off on releasing a new engine file until sometime next week so I can gather any other bug fixes into it. I don’t want to flood people’s inboxes with MTE updates. Let me know if you find anything else!