Fix: crash while lazy loading player textures upstream#591
This commit is contained in:
parent
dbc4736282
commit
35c1013bbb
|
@ -35,7 +35,7 @@ export const lazyLoadPlayerCharacterTextures = (loadPlugin: LoaderPlugin, textur
|
|||
const textureName = typeof textureKey === 'string' ? textureKey : textureKey.name;
|
||||
if(!texturePlugin.exists(textureName)) {
|
||||
console.log('Loading '+textureName)
|
||||
const playerResourceDescriptor = typeof textureKey !== 'string' && textureKey.img ? textureKey : getRessourceDescriptor(textureKey as unknown as string);
|
||||
const playerResourceDescriptor = typeof textureKey !== 'string' && textureKey.img ? textureKey : getRessourceDescriptor((typeof textureKey == 'object') ? textureKey.name : textureKey as unknown as string);
|
||||
promisesList.push(createLoadingPromise(loadPlugin, playerResourceDescriptor));
|
||||
}
|
||||
})
|
||||
|
@ -68,4 +68,4 @@ const createLoadingPromise = (loadPlugin: LoaderPlugin, playerResourceDescriptor
|
|||
loadPlugin.spritesheet(playerResourceDescriptor.name, playerResourceDescriptor.img, {frameWidth: 32, frameHeight: 32});
|
||||
loadPlugin.once('filecomplete-spritesheet-'+playerResourceDescriptor.name, () => res());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue