From 42782589e0a16a66faeae554c83db6867a555774 Mon Sep 17 00:00:00 2001 From: phrisk Date: Tue, 27 Feb 2024 23:45:47 +0000 Subject: [PATCH] Return after returning player offers to avoid redundant remove offer following (!237) #### Summary > Should fix [Issue 523](https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/523) Tested a few different scenarios and the items were always correctly removed and returned to the player, however I did see the console warnings reported in the issue. Both of the following call `this.ragfairOfferHandler.removeOffer(...)`: - `this.returnPlayerOffer(...)` - `this.removeOfferById(...)` The latter logs a warning to the console because the offer is already removed when we reach that point. This fix simply returns after the offer has been returned to the player, letting `returnPlayerOffer` deal with removing from the flea Co-authored-by: phrisk Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/237 Co-authored-by: phrisk Co-committed-by: phrisk --- project/src/services/RagfairOfferService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/project/src/services/RagfairOfferService.ts b/project/src/services/RagfairOfferService.ts index 900b6596..7b12174c 100644 --- a/project/src/services/RagfairOfferService.ts +++ b/project/src/services/RagfairOfferService.ts @@ -229,6 +229,7 @@ export class RagfairOfferService if (isPlayer && staleOffer.endTime <= this.timeUtil.getTimestamp()) { this.returnPlayerOffer(staleOffer); + return; } // Remove expired existing offer from global offers