From 1a57c1f7f37a6615fa8d9eda7ddc729072770264 Mon Sep 17 00:00:00 2001 From: Shivendra Date: Mon, 6 May 2024 12:02:03 +0530 Subject: [PATCH] fixes Creature Dash arrow keys error --- src/ui/interface.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ui/interface.js b/src/ui/interface.js index e5bf37ef7..9b5bc2c7d 100644 --- a/src/ui/interface.js +++ b/src/ui/interface.js @@ -836,6 +836,7 @@ export class UI { this.selectedCreature = creatureType; const stats = game.retrieveCreatureStats(creatureType); + if (stats === undefined) return; //function to add the name, realm, size etc of the current card in the menu function addCardCharacterInfo() { @@ -949,7 +950,7 @@ export class UI { .children('#upgrade') .text('Upgrade: ' + stats.ability_info[key].upgrade); - if (key !== 0) { + if (stats.ability_info[key].costs !== undefined && key !== 0) { $ability .children('.wrapper') .children('.info') @@ -1138,7 +1139,8 @@ export class UI { } else { $ability.children('.wrapper').children('.info').children('#upgrade').text(' '); } - if (key !== 0) { + + if (stats.ability_info[key].costs !== undefined && key !== 0) { $ability .children('.wrapper') .children('.info') @@ -1569,6 +1571,10 @@ export class UI { if (game.realms.indexOf(creatureType[0]) - 1 > -1) { const realm = game.realms[game.realms.indexOf(creatureType[0]) - 1]; + + if (realm === '-') { + return; + } nextCreature = realm + creatureType[1]; this.lastViewedCreature = nextCreature; this.showCreature(nextCreature, this.selectedPlayer);