I have observed the trouble when I remove tile from a map, and then somehow when I check on the same map position, it returns a positive value through “hasProperty” method.
I looked through the tile:destroy method, and it shows it doesn’t remove properties.
a quick solution to this is:
function Tile:destroy()
if self.properties then
self.properties = nil
end
if self.sprite then
self.sprite:removeSelf()
self.sprite = nil
end
end
function Tile:getProperty(name)
if self.properties then
return self.properties[name]
else
return nil
end
end
and now doing layer:removeTileAt(…) and then getting tile at the same position with layer:getTileAt(…) and then calling tile:hasProperty, returns negative value.
Maybe it is something wrong with my code? I have double-checked the source, I am doing a local declaration of “tile”, and then calling the right methods… [import]uid: 10881 topic_id: 6730 reply_id: 306730[/import]