Skip to content

Commit cc5d1d0

Browse files
committed
Loader: loading from pack data
- Corrected logic where packs added via data would still try to be loaded. This makes the behavior correct per the documentation and v2.2
1 parent 6cf982a commit cc5d1d0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/loader/Loader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,9 @@ Phaser.Loader.prototype = {
572572
}
573573

574574
pack.data = data || {};
575+
576+
// Already consider 'loaded'
577+
pack.loaded = true;
575578
}
576579

577580
// Add before first non-pack/no-loaded ~ last pack from start prior to loading
@@ -1252,11 +1255,8 @@ Phaser.Loader.prototype = {
12521255
var file = this._fileList[i];
12531256

12541257
// Pack is fetched (ie. has data) and is currently at the start of the process queue.
1255-
if (file.type === 'packfile' && !file.error && file.data && i === this._processingHead)
1258+
if (file.type === 'packfile' && !file.error && file.loaded && i === this._processingHead)
12561259
{
1257-
// Pack may have been supplied with initial data
1258-
this.loaded = true;
1259-
12601260
// Processing the pack / adds more files
12611261
this.processPack(file);
12621262

0 commit comments

Comments
 (0)