Skip to content

Commit b115329

Browse files
committed
Tilemap.fill would throw an error if called on a blank tilemap full of null values (thanks @DrHackenstein, fix phaserjs#761)
1 parent ce6215c commit b115329

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Version 2.0.4 - "Mos Shirare" - in development
138138
* Fixed Polygon.contains for coordinates to the left of the polygon (thanks @vilcans, fix #766)
139139
* Fixed issue where game pause/resume could incorrectly increment paused Timers (thanks @georgiee, fix #759)
140140
* Fixed issue where Animations resuming from a pause would skip frames (thanks @merixstudio, fix #730)
141+
* Tilemap.fill would throw an error if called on a blank tilemap full of null values (thanks @DrHackenstein, fix #761)
141142

142143

143144
### ToDo

src/tilemap/Tilemap.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,10 @@ Phaser.Tilemap.prototype = {
15191519

15201520
for (var i = 1; i < this._results.length; i++)
15211521
{
1522-
this._results[i].index = index;
1522+
if (this._results[i] !== null)
1523+
{
1524+
this._results[i].index = index;
1525+
}
15231526
}
15241527

15251528
this.paste(x, y, this._results, layer);

src/time/Timer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Phaser.Timer.prototype = {
211211
},
212212

213213
/**
214-
* Adds a new Event to this Timer that will repeat for the given number of iterations.
214+
* Adds a new TimerEvent that will always play through once and then repeat for the given number of iterations.
215215
* The event will fire after the given amount of 'delay' milliseconds has passed once the Timer has started running.
216216
* Call Timer.start() once you have added all of the Events you require for this Timer. The delay is in relation to when the Timer starts, not the time it was added.
217217
* If the Timer is already running the delay will be calculated based on the timers current time.

0 commit comments

Comments
 (0)