From 5b75d028bf590fde0715af18ce4e27d652e2da57 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Thu, 14 Jan 2021 11:38:20 +0100 Subject: [PATCH] fixed a crash linked to incorrect textureDescriptors --- front/src/Phaser/Entity/PlayerTexturesLoadingManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Phaser/Entity/PlayerTexturesLoadingManager.ts b/front/src/Phaser/Entity/PlayerTexturesLoadingManager.ts index c2a421e5..8f190687 100644 --- a/front/src/Phaser/Entity/PlayerTexturesLoadingManager.ts +++ b/front/src/Phaser/Entity/PlayerTexturesLoadingManager.ts @@ -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' ? getRessourceDescriptor(textureKey) : textureKey; + const playerResourceDescriptor = typeof textureKey !== 'string' && textureKey.img ? textureKey : getRessourceDescriptor(textureKey as unknown as string); promisesList.push(createLoadingPromise(loadPlugin, playerResourceDescriptor)); } })