From dcb98f7d1b21ccde76d0a6c26514a718290b19b6 Mon Sep 17 00:00:00 2001 From: HiddenCirno <2301697863@qq.com> Date: Sun, 21 Jul 2024 08:02:44 +0000 Subject: [PATCH] fix free change still deduct trader standing (!379) Fix that free change repeatable chance quest still deduct trader standing, now it will deduct when player have no access to free change or have no free change counts Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/379 Co-authored-by: HiddenCirno <2301697863@qq.com> Co-committed-by: HiddenCirno <2301697863@qq.com> --- project/src/controllers/RepeatableQuestController.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/project/src/controllers/RepeatableQuestController.ts b/project/src/controllers/RepeatableQuestController.ts index 79e31e31..2774897a 100644 --- a/project/src/controllers/RepeatableQuestController.ts +++ b/project/src/controllers/RepeatableQuestController.ts @@ -595,6 +595,9 @@ export class RepeatableQuestController const isFreeToReplace = this.useFreeRefreshIfAvailable(fullProfile, repeatablesInProfile, repeatableTypeLower); if (!isFreeToReplace) { + // Reduce standing with trader for not doing their quest + const traderOfReplacedQuest = pmcData.TradersInfo[replacedQuestTraderId]; + traderOfReplacedQuest.standing -= previousChangeRequirement.changeStandingCost; // not free, Charge player for (const cost of previousChangeRequirement.changeCost) { @@ -621,10 +624,6 @@ export class RepeatableQuestController return this.httpResponse.appendErrorToOutput(output, message); } - // Reduce standing with trader for not doing their quest - const traderOfReplacedQuest = pmcData.TradersInfo[replacedQuestTraderId]; - traderOfReplacedQuest.standing -= previousChangeRequirement.changeStandingCost; - // Nullguard output.profileChanges[sessionID].repeatableQuests ||= [];