From bd0054279356de1c7e4cf3fb1ad490a713e3f4af Mon Sep 17 00:00:00 2001 From: Chomp Date: Thu, 9 Jan 2025 10:52:36 +0000 Subject: [PATCH] Reduce server start time when running in debug mode by generating less flea offers --- project/src/generators/RagfairOfferGenerator.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/project/src/generators/RagfairOfferGenerator.ts b/project/src/generators/RagfairOfferGenerator.ts index bc9a806c..86e37062 100644 --- a/project/src/generators/RagfairOfferGenerator.ts +++ b/project/src/generators/RagfairOfferGenerator.ts @@ -1,3 +1,4 @@ +import { ProgramStatics } from "@spt/ProgramStatics"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { BotHelper } from "@spt/helpers/BotHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper"; @@ -386,10 +387,14 @@ export class RagfairOfferGenerator { // Get number of offers to create // Limit to 1 offer when processing expired - like-for-like replacement - const offerCount = isExpiredOffer + let offerCount = isExpiredOffer ? 1 : Math.round(this.randomUtil.getInt(config.offerItemCount.min, config.offerItemCount.max)); + if (ProgramStatics.DEBUG && !ProgramStatics.COMPILED) { + offerCount = 2; + } + // Store all functions to create offers for this item and pass into Promise.all to run async const assortSingleOfferProcesses = []; for (let index = 0; index < offerCount; index++) {