not a great fan of mixed-type arrays but this will do for now...
authorRichard Fairhurst <richard@systemed.net>
Mon, 7 Mar 2011 13:27:52 +0000 (13:27 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 9 Mar 2011 11:27:22 +0000 (11:27 +0000)
net/systemeD/halcyon/TileSet.as

index 12050f4..0d2b4ec 100644 (file)
@@ -195,11 +195,13 @@ package net.systemeD.halcyon {
                
                protected function purgeTiles():void {
                        for (var tile:String in tiles) {
-                               var coords:Array=tile.split(','); var tz:uint=coords[0]; var tx:uint=coords[1]; var ty:uint=coords[1];
-                               if (tz!=map.scale || tx<tile_l || tx>tile_r || ty<tile_t || ty<tile_b) {
-                                       if (tiles[tile].parent) tiles[tile].parent.removeChild(tiles[tile]);
-                                       delete tiles[tile];
-                                       loadcount--;
+                               if (tiles[tile] is Sprite) {
+                                       var coords:Array=tile.split(','); var tz:uint=coords[0]; var tx:uint=coords[1]; var ty:uint=coords[1];
+                                       if (tz!=map.scale || tx<tile_l || tx>tile_r || ty<tile_t || ty<tile_b) {
+                                               if (tiles[tile].parent) tiles[tile].parent.removeChild(tiles[tile]);
+                                               delete tiles[tile];
+                                               loadcount--;
+                                       }
                                }
                        }
                }