Fixed bot generation warnings where a value of 0 was treated the same as no value found

This commit is contained in:
Dev 2024-11-14 20:59:37 +00:00
parent 5e067b46f1
commit f11e09b46b

View File

@ -271,7 +271,7 @@ export class BotGenerator {
role: string, role: string,
): number { ): number {
const result = experience[botDifficulty.toLowerCase()]; const result = experience[botDifficulty.toLowerCase()];
if (!result) { if (typeof result === "undefined") {
this.logger.warning( this.logger.warning(
`Unable to find experience for kill value for: ${role} ${botDifficulty}, falling back to "normal"`, `Unable to find experience for kill value for: ${role} ${botDifficulty}, falling back to "normal"`,
); );
@ -295,7 +295,7 @@ export class BotGenerator {
role: string, role: string,
): number { ): number {
const result = standingForKill[botDifficulty.toLowerCase()]; const result = standingForKill[botDifficulty.toLowerCase()];
if (!result) { if (typeof result === "undefined") {
this.logger.warning( this.logger.warning(
`Unable to find standing for kill value for: ${role} ${botDifficulty}, falling back to "normal"`, `Unable to find standing for kill value for: ${role} ${botDifficulty}, falling back to "normal"`,
); );
@ -319,7 +319,7 @@ export class BotGenerator {
role: string, role: string,
): number { ): number {
const result = aggressorBonus[botDifficulty.toLowerCase()]; const result = aggressorBonus[botDifficulty.toLowerCase()];
if (!result) { if (typeof result === "undefined") {
this.logger.warning( this.logger.warning(
`Unable to find aggressor bonus for kill value for: ${role} ${botDifficulty}, falling back to "normal"`, `Unable to find aggressor bonus for kill value for: ${role} ${botDifficulty}, falling back to "normal"`,
); );