layer:removeTileAt does not remove properties?

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 

Awesome, another silly oversight by me fixed by you guys. Will be in 2.8

views:1427 update:2011/10/13 16:39:51
corona forums © 2003-2011