If offer to remove is not found, don't reduce rep loss

This commit is contained in:
Dev 2023-11-14 16:09:45 +00:00
parent f0358f5241
commit 844cb12cc1

View File

@ -236,15 +236,15 @@ export class RagfairOfferService
const sessionID = profile.sessionId; const sessionID = profile.sessionId;
const offerIndex = profile.RagfairInfo.offers.findIndex(o => o._id === offer._id); 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) if (offerIndex === -1)
{ {
this.logger.warning(this.localisationService.getText("ragfair-unable_to_find_offer_to_remove", offer._id)); 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")); 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) if (offer.items[0].upd.StackObjectsCount > offer.items[0].upd.OriginalStackObjectsCount)
{ {
offer.items[0].upd.StackObjectsCount = offer.items[0].upd.OriginalStackObjectsCount; offer.items[0].upd.StackObjectsCount = offer.items[0].upd.OriginalStackObjectsCount;