Skip to content

Commit 86e8c76

Browse files
author
Builder
committed
Merge branch 'fix-error-sprite-null' into 'master'
[FIX][SDK] fix null sprite image error See merge request codingame/game-engine!163
2 parents f46a8a9 + ecf2f7a commit 86e8c76

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

engine/modules/entities/src/main/resources/view/entity-module/Sprite.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export class Sprite extends TextureBasedEntity {
2828
super.updateDisplay(state, changed, globalData)
2929
if (changed.image) {
3030
try {
31-
this.graphics.texture = PIXI.Texture.fromFrame(state.image)
31+
if (state.image !== null) {
32+
this.graphics.texture = PIXI.Texture.fromFrame(state.image)
33+
} else {
34+
this.graphics.texture = PIXI.Texture.EMPTY
35+
}
3236
} catch (error) {
3337
if (!this.missingTextures[state.image]) {
3438
this.missingTextures[state.image] = true

playground/misc/misc-3-release-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ The CodinGame SDK is regularly updated and improved. This document lets you know
77

88
- A frame is created even if no players have been executed at the end of each gameTurn.
99

10+
### 🐞 Bug fix
11+
12+
- Fixed an issue with sprites
13+
1014
## 3.0.0
1115
*January 11, 2019*
1216

0 commit comments

Comments
 (0)