From 457c69f2dfe15ff4f5669374dc9369f91d86210b Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Fri, 25 Aug 2023 11:13:28 -0700 Subject: [PATCH] Fix errors caused by undefined values. --- game/game.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/game.js b/game/game.js index e2520a97b..f1969f2a4 100644 --- a/game/game.js +++ b/game/game.js @@ -37563,7 +37563,7 @@ } if(info.ai==undefined) info.ai={}; const skill=info.ai,card=lib.card[info.viewAs.name].ai; - Object.keys(card).forEach(value=>{ + if(card) Object.keys(card).forEach(value=>{ if(skill[value]==undefined) skill[value]=card[value]; else if(typeof skill[value]=='object') Object.keys(card[value]).forEach(element=>{ if(skill[value][element]==undefined) skill[value][element]=card[value][element]; @@ -37572,7 +37572,7 @@ } if(info.inherit){ const skill=lib.skill[info.inherit]; - Object.keys(skill).forEach(value=>{ + if(skill) Object.keys(skill).forEach(value=>{ if(info[value]!=undefined) return; if(value=='audio'&&(typeof info[value]=='number'||typeof info[value]=='boolean')) info[value]=info.inherit; else info[value]=skill[value];