From 12cda6acb896fb2ffc6d01385435e8b7b37c8bdd Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 10 Dec 2023 13:18:14 +0000 Subject: [PATCH] `getWeaponRepairSkillPoints()` has a chance to return 0 due to the possibility of a critical failure, only run `addSkillPointsToPlayer()` if value is above 0 --- project/src/services/RepairService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/project/src/services/RepairService.ts b/project/src/services/RepairService.ts index 3a099022..a5d6e113 100644 --- a/project/src/services/RepairService.ts +++ b/project/src/services/RepairService.ts @@ -154,7 +154,10 @@ export class RepairService { const skillPoints = this.getWeaponRepairSkillPoints(repairDetails); - this.profileHelper.addSkillPointsToPlayer(pmcData, SkillTypes.WEAPON_TREATMENT, skillPoints, true); + if (skillPoints > 0) + { + this.profileHelper.addSkillPointsToPlayer(pmcData, SkillTypes.WEAPON_TREATMENT, skillPoints, true); + } } // Handle kit repairs of armor