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
This commit is contained in:
Paul 2015-03-15 20:26:37 -07:00
parent 6cf982a4a0
commit cc5d1d02e5

View file

@ -572,6 +572,9 @@ Phaser.Loader.prototype = {
}
pack.data = data || {};
// Already consider 'loaded'
pack.loaded = true;
}
// Add before first non-pack/no-loaded ~ last pack from start prior to loading
@ -1252,11 +1255,8 @@ Phaser.Loader.prototype = {
var file = this._fileList[i];
// Pack is fetched (ie. has data) and is currently at the start of the process queue.
if (file.type === 'packfile' && !file.error && file.data && i === this._processingHead)
if (file.type === 'packfile' && !file.error && file.loaded && i === this._processingHead)
{
// Pack may have been supplied with initial data
this.loaded = true;
// Processing the pack / adds more files
this.processPack(file);