Skip to content

Commit

Permalink
Fixed a bug about missing url
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualSJ committed Dec 14, 2016
1 parent b9bc328 commit 32d2f3d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cocos2d/core/load-pipeline/loading-items.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ function createItem (id, queueId) {
var result, urlItem;
if (typeof id === 'object' && id.id) {
if (!id.type) {
id.type = Path.extname(id.id).toLowerCase().substr(1);
id.type = Path.extname(id.url).toLowerCase().substr(1);
}
urlItem = _parseUrl(id.url || id.id);
urlItem = _parseUrl(id.url);
result = {
queueId: queueId,
url: urlItem.url,
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/load-pipeline/pack-downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = {
_loadNewPack: function (uuid, packUuid, callback) {
var self = this;
var packUrl = cc.AssetLibrary.getImportedDir(packUuid) + '/' + packUuid + '.json';
LoadingItems.create(cc.loader, [{id: packUrl, ignoreMaxConcurrency: true}], function (err, queue) {
LoadingItems.create(cc.loader, [{url: packUrl, ignoreMaxConcurrency: true}], function (err, queue) {
if (err) {
cc.error('Failed to download package for ' + uuid);
return callback(err);
Expand Down
8 changes: 4 additions & 4 deletions test/qunit/unit/test-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('items', function () {
var items = cc.LoadingItems.create(pipeline, [
'res/Background.png',
{
id: 'res/scene.json',
url: 'res/scene.json',
type: 'scene',
name: 'scene'
}
Expand Down Expand Up @@ -111,7 +111,7 @@ test('pipeline flow', function () {
var items = cc.LoadingItems.create(pipeline, [
'res/Background.png',
{
id: 'res/scene.json',
url: 'res/scene.json',
type: 'scene',
name: 'scene'
},
Expand Down Expand Up @@ -222,7 +222,7 @@ asyncTest('content manipulation', function () {
var items = cc.LoadingItems.create(pipeline, [
'res/Background.png',
{
id: 'res/scene.json',
url: 'res/scene.json',
type: 'scene'
},
'res/role.plist',
Expand All @@ -235,4 +235,4 @@ asyncTest('content manipulation', function () {
}, 2);
});

})();
})();

0 comments on commit 32d2f3d

Please sign in to comment.