Skip to content

Commit

Permalink
Reduce server start time when running in debug mode by generating les…
Browse files Browse the repository at this point in the history
…s flea offers
  • Loading branch information
Chomp committed Jan 9, 2025
1 parent f5600fe commit bd00542
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion project/src/generators/RagfairOfferGenerator.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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++) {
Expand Down

0 comments on commit bd00542

Please sign in to comment.