Skip to content

Commit 7b83d31

Browse files
committed
The Update List now uses the new checkQueue property to ensure no duplicate objects are on the active list.
1 parent 7f5e4d4 commit 7b83d31

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/gameobjects/UpdateList.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ var UpdateList = new Class({
3535
{
3636
ProcessQueue.call(this);
3737

38+
// No duplicates in this list
39+
this.checkQueue = true;
40+
3841
/**
3942
* The Scene that the Update List belongs to.
4043
*
@@ -157,7 +160,7 @@ var UpdateList = new Class({
157160

158161
/**
159162
* The Scene that owns this plugin is shutting down.
160-
*
163+
*
161164
* We need to kill and reset all internal properties as well as stop listening to Scene events.
162165
*
163166
* @method Phaser.GameObjects.UpdateList#shutdown
@@ -203,7 +206,7 @@ var UpdateList = new Class({
203206

204207
/**
205208
* The Scene that owns this plugin is being destroyed.
206-
*
209+
*
207210
* We need to shutdown and then kill off all external references.
208211
*
209212
* @method Phaser.GameObjects.UpdateList#destroy
@@ -221,7 +224,7 @@ var UpdateList = new Class({
221224

222225
/**
223226
* Adds a new item to the Update List.
224-
*
227+
*
225228
* The item is added to the pending list and made active in the next update.
226229
*
227230
* @method Phaser.GameObjects.UpdateList#add
@@ -234,7 +237,7 @@ var UpdateList = new Class({
234237

235238
/**
236239
* Removes an item from the Update List.
237-
*
240+
*
238241
* The item is added to the pending destroy and fully removed in the next update.
239242
*
240243
* @method Phaser.GameObjects.UpdateList#remove
@@ -247,7 +250,7 @@ var UpdateList = new Class({
247250

248251
/**
249252
* Removes all active items from this Update List.
250-
*
253+
*
251254
* All the items are marked as 'pending destroy' and fully removed in the next update.
252255
*
253256
* @method Phaser.GameObjects.UpdateList#removeAll
@@ -258,7 +261,7 @@ var UpdateList = new Class({
258261

259262
/**
260263
* Update this queue. First it will process any items awaiting destruction, and remove them.
261-
*
264+
*
262265
* Then it will check to see if there are any items pending insertion, and move them to an
263266
* active state. Finally, it will return a list of active items for further processing.
264267
*
@@ -270,7 +273,7 @@ var UpdateList = new Class({
270273

271274
/**
272275
* Returns the current list of active items.
273-
*
276+
*
274277
* This method returns a reference to the active list array, not a copy of it.
275278
* Therefore, be careful to not modify this array outside of the ProcessQueue.
276279
*

0 commit comments

Comments
 (0)