From 8853159b559354bb0cb488da45c62ebc12ea2097 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 18 Dec 2023 22:32:46 +0000 Subject: [PATCH] Fix player offers being expired before checking if they were sold --- project/src/callbacks/RagfairCallbacks.ts | 7 +++++-- project/src/controllers/RagfairController.ts | 3 +++ project/src/helpers/InRaidHelper.ts | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/project/src/callbacks/RagfairCallbacks.ts b/project/src/callbacks/RagfairCallbacks.ts index b60c8f11..54cde83f 100644 --- a/project/src/callbacks/RagfairCallbacks.ts +++ b/project/src/callbacks/RagfairCallbacks.ts @@ -61,10 +61,13 @@ export class RagfairCallbacks implements OnLoad, OnUpdate { // There is a flag inside this class that only makes it run once. this.ragfairServer.addPlayerOffers(); - await this.ragfairServer.update(); - // function below used to be split, merged + + // Check player offers and mail payment to player if sold this.ragfairController.update(); + // Process all offers / expire offers + await this.ragfairServer.update(); + return true; } diff --git a/project/src/controllers/RagfairController.ts b/project/src/controllers/RagfairController.ts index 07c7e30b..2c4231fc 100644 --- a/project/src/controllers/RagfairController.ts +++ b/project/src/controllers/RagfairController.ts @@ -307,6 +307,9 @@ export class RagfairController return info.neededSearchId !== ""; } + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ public update(): void { for (const sessionID in this.saveServer.getProfiles()) diff --git a/project/src/helpers/InRaidHelper.ts b/project/src/helpers/InRaidHelper.ts index 8e1f17a2..607a4e6d 100644 --- a/project/src/helpers/InRaidHelper.ts +++ b/project/src/helpers/InRaidHelper.ts @@ -523,7 +523,7 @@ export class InRaidHelper // Add the new items serverProfile.Inventory.items = [...postRaidProfile.Inventory.items, ...serverProfile.Inventory.items]; - serverProfile.Inventory.fastPanel = postRaidProfile.Inventory.fastPanel; + serverProfile.Inventory.fastPanel = postRaidProfile.Inventory.fastPanel; // Quick access items bar serverProfile.InsuredItems = insured; return serverProfile;