TilemapParser accidentally redeclared i when parsing the ImageCollections which would cause an infinite loop (thanks DanHett)

This commit is contained in:
photonstorm 2015-11-12 13:39:42 +00:00
parent 1c169ef571
commit 8b0224e7b4
2 changed files with 4 additions and 3 deletions

View file

@ -279,6 +279,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
### Bug Fixes
* Buttons (or any Sprites) that don't have a texture, but have children, would incorrectly render the children under WebGL due to the baseTexture.skipRender property (thanks @puzzud #2141)
* TilemapParser accidentally redeclared `i` when parsing the ImageCollections which would cause an infinite loop (thanks DanHett)
### Pixi Updates

View file

@ -446,10 +446,10 @@ Phaser.TilemapParser = {
{
var newCollection = new Phaser.ImageCollection(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing, set.properties);
for (var i in set.tiles)
for (var ti in set.tiles)
{
var image = set.tiles[i].image;
var gid = set.firstgid + parseInt(i, 10);
var image = set.tiles[ti].image;
var gid = set.firstgid + parseInt(ti, 10);
newCollection.addImage(gid, image);
}