From 844cb12cc16b0a6fe91f1684a05bed449d44c572 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 14 Nov 2023 16:09:45 +0000 Subject: [PATCH] If offer to remove is not found, don't reduce rep loss --- project/src/services/RagfairOfferService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/src/services/RagfairOfferService.ts b/project/src/services/RagfairOfferService.ts index 07feab5b..4392bab0 100644 --- a/project/src/services/RagfairOfferService.ts +++ b/project/src/services/RagfairOfferService.ts @@ -236,15 +236,15 @@ export class RagfairOfferService const sessionID = profile.sessionId; const offerIndex = profile.RagfairInfo.offers.findIndex(o => o._id === offer._id); - profile.RagfairInfo.rating -= this.ragfairConfig.sell.reputation.loss; - profile.RagfairInfo.isRatingGrowing = false; - if (offerIndex === -1) { this.logger.warning(this.localisationService.getText("ragfair-unable_to_find_offer_to_remove", offer._id)); return this.httpResponse.appendErrorToOutput(this.eventOutputHolder.getOutput(sessionID), this.localisationService.getText("ragfair-offer_not_found_in_profile_short")); } + profile.RagfairInfo.rating -= this.ragfairConfig.sell.reputation.loss; + profile.RagfairInfo.isRatingGrowing = false; + if (offer.items[0].upd.StackObjectsCount > offer.items[0].upd.OriginalStackObjectsCount) { offer.items[0].upd.StackObjectsCount = offer.items[0].upd.OriginalStackObjectsCount;