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>
This commit is contained in:
HiddenCirno 2024-07-21 08:02:44 +00:00 committed by chomp
parent 014826e683
commit dcb98f7d1b

View File

@ -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 ||= [];