diff options
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/player/DecalPlayer.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java index d7cb680..8f4e601 100644 --- a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java +++ b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java @@ -68,12 +68,16 @@ public class DecalPlayer { private void updateTextureRegion() { this.regionIndex++; + TextureRegion region; - if (this.regions.get(this.regionIndex) == null) { + try { + region = this.regions.get(this.regionIndex); + } catch (Exception ignored) { this.regionIndex = 0; + region = this.regions.get(regionIndex); } - this.decal.setTextureRegion(this.regions.get(this.regionIndex)); + this.decal.setTextureRegion(region); } public Decal getDecal() { |
