Skip to content

Commit 8b0224e

Browse files
committed
TilemapParser accidentally redeclared i when parsing the ImageCollections which would cause an infinite loop (thanks DanHett)
1 parent 1c169ef commit 8b0224e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
279279
### Bug Fixes
280280

281281
* 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)
282+
* TilemapParser accidentally redeclared `i` when parsing the ImageCollections which would cause an infinite loop (thanks DanHett)
282283

283284
### Pixi Updates
284285

src/tilemap/TilemapParser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,10 @@ Phaser.TilemapParser = {
446446
{
447447
var newCollection = new Phaser.ImageCollection(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing, set.properties);
448448

449-
for (var i in set.tiles)
449+
for (var ti in set.tiles)
450450
{
451-
var image = set.tiles[i].image;
452-
var gid = set.firstgid + parseInt(i, 10);
451+
var image = set.tiles[ti].image;
452+
var gid = set.firstgid + parseInt(ti, 10);
453453
newCollection.addImage(gid, image);
454454
}
455455

0 commit comments

Comments
 (0)