From 5071072092433aa2106c2ea0fbe2b3f4f15e45fd Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 22 Jul 2023 14:16:19 +0100 Subject: [PATCH] Place fence seasonal item blocking behind config propery --- project/assets/configs/trader.json | 1 + project/src/generators/FenceBaseAssortGenerator.ts | 2 +- project/src/models/spt/config/ITraderConfig.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/project/assets/configs/trader.json b/project/assets/configs/trader.json index 067c80c8..cff1ad2f 100644 --- a/project/assets/configs/trader.json +++ b/project/assets/configs/trader.json @@ -90,6 +90,7 @@ { "59e690b686f7746c9f75e848": {"min": 5, "max": 15} }, + "blacklistSeasonalItems": true, "blacklist": [ "5661632d4bdc2d903d8b456b", "543be5e94bdc2df1348b4568", diff --git a/project/src/generators/FenceBaseAssortGenerator.ts b/project/src/generators/FenceBaseAssortGenerator.ts index 45570313..15eea71f 100644 --- a/project/src/generators/FenceBaseAssortGenerator.ts +++ b/project/src/generators/FenceBaseAssortGenerator.ts @@ -73,7 +73,7 @@ export class FenceBaseAssortGenerator } // Skip seasonal event items when not in seasonal event - if (blockedSeasonalItems.includes(item._id)) + if (this.traderConfig.fence.blacklistSeasonalItems && blockedSeasonalItems.includes(item._id)) { continue; } diff --git a/project/src/models/spt/config/ITraderConfig.ts b/project/src/models/spt/config/ITraderConfig.ts index 8e8922c9..f76a3dc4 100644 --- a/project/src/models/spt/config/ITraderConfig.ts +++ b/project/src/models/spt/config/ITraderConfig.ts @@ -34,6 +34,8 @@ export interface FenceConfig itemStackSizeOverrideMinMax: Record itemTypeLimits: Record regenerateAssortsOnRefresh: boolean + /** Block seasonal items from appearing when season is inactive */ + blacklistSeasonalItems: boolean; blacklist: string[] }