From f11e09b46b5c777ae307d90612c8d2020988914e Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 14 Nov 2024 20:59:37 +0000 Subject: [PATCH] Fixed bot generation warnings where a value of 0 was treated the same as no value found --- project/src/generators/BotGenerator.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/src/generators/BotGenerator.ts b/project/src/generators/BotGenerator.ts index b4b4d3fe..9320632e 100644 --- a/project/src/generators/BotGenerator.ts +++ b/project/src/generators/BotGenerator.ts @@ -271,7 +271,7 @@ export class BotGenerator { role: string, ): number { const result = experience[botDifficulty.toLowerCase()]; - if (!result) { + if (typeof result === "undefined") { this.logger.warning( `Unable to find experience for kill value for: ${role} ${botDifficulty}, falling back to "normal"`, ); @@ -295,7 +295,7 @@ export class BotGenerator { role: string, ): number { const result = standingForKill[botDifficulty.toLowerCase()]; - if (!result) { + if (typeof result === "undefined") { this.logger.warning( `Unable to find standing for kill value for: ${role} ${botDifficulty}, falling back to "normal"`, ); @@ -319,7 +319,7 @@ export class BotGenerator { role: string, ): number { const result = aggressorBonus[botDifficulty.toLowerCase()]; - if (!result) { + if (typeof result === "undefined") { this.logger.warning( `Unable to find aggressor bonus for kill value for: ${role} ${botDifficulty}, falling back to "normal"`, );