From 3a301b02ccd768c6297f871f275eff10f5a9d825 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 28 Feb 2024 18:34:25 +0000 Subject: [PATCH] Handle when pscav kills a bot that doesnt have a json, default to 0 rep loss --- project/src/helpers/InRaidHelper.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/project/src/helpers/InRaidHelper.ts b/project/src/helpers/InRaidHelper.ts index 299d5443..2a1a44da 100644 --- a/project/src/helpers/InRaidHelper.ts +++ b/project/src/helpers/InRaidHelper.ts @@ -95,6 +95,11 @@ export class InRaidHelper for (const victim of victims) { let standingChangeForKill = this.getFenceStandingChangeForKillAsScav(victim); + if (standingChangeForKill === 0) + { + // Nothing to do, skip + continue; + } if (victim.Name?.includes(")") && victim.Side === "Savage") { // Make value positive if traitor scav @@ -144,10 +149,13 @@ export class InRaidHelper const botTypes = this.databaseServer.getTables().bots.types; if (victim.Side.toLowerCase() === "savage") { - const standing = botTypes[victim.Role.toLowerCase()]?.experience?.standingForKill; + let standing = botTypes[victim.Role.toLowerCase()]?.experience?.standingForKill; if (standing === undefined) { - this.logger.warning(`Unable to find standing for kill for: ${victim.Role}, side: ${victim.Side}`); + this.logger.warning( + `Unable to find standing for kill for: ${victim.Role}, side: ${victim.Side}, setting to: 0`, + ); + standing = 0; } // Scavs and bosses