From 9f9b26cda821731b823b27c8120e3a84e10bd547 Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Sun, 28 Jul 2024 13:17:33 -0700 Subject: [PATCH] Remove server barter fix (fixed in spt) --- Patches/UnloadAmmoPatches.cs | 4 ++-- server/src/mod.ts | 32 -------------------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/Patches/UnloadAmmoPatches.cs b/Patches/UnloadAmmoPatches.cs index af2299b..7de05b6 100644 --- a/Patches/UnloadAmmoPatches.cs +++ b/Patches/UnloadAmmoPatches.cs @@ -223,8 +223,8 @@ public static class UnloadAmmoPatches else { var profile = PatchConstants.BackEndSession.Profile; - StashClass fakeStash = (StashClass)Singleton.Instance.CreateItem("FakeStash", "566abbc34bdc2d92178b4576", null); - return new(fakeStash, profile.ProfileId, profile.Nickname); + StashClass fakeStash = Singleton.Instance.CreateFakeStash(); + return new TraderControllerClass(fakeStash, profile.ProfileId, profile.Nickname); } } } diff --git a/server/src/mod.ts b/server/src/mod.ts index ce41278..a4301ea 100644 --- a/server/src/mod.ts +++ b/server/src/mod.ts @@ -13,8 +13,6 @@ import type { ICloner } from "@spt/utils/cloners/ICloner"; import { RagfairLinkedSlotItemService } from "./RagfairLinkedSlotItemService"; import config from "../config/config.json"; -import { RagfairOfferGenerator } from "@spt/generators/RagfairOfferGenerator"; -import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; class UIFixes implements IPreSptLoadMod { private databaseService: DatabaseService; @@ -52,36 +50,6 @@ class UIFixes implements IPreSptLoadMod { { frequency: "Always" } ); - // Trader offers with dogtag barter - fixed in next SPT release *after* 3.9.3 - container.afterResolution( - "RagfairOfferGenerator", - (_, ragfairOfferGenerator: RagfairOfferGenerator) => { - const original = ragfairOfferGenerator["createOffer"]; // By name because protected - - ragfairOfferGenerator["createOffer"] = (userID, time, items, barterScheme, loyalLevel, isPackOffer) => { - const offer: IRagfairOffer = original.call( - ragfairOfferGenerator, - userID, - time, - items, - barterScheme, - loyalLevel, - isPackOffer - ); - - for (let i = 0; i < offer.requirements.length; i++) { - if (barterScheme[i]["level"] !== undefined) { - offer.requirements[i]["level"] = barterScheme[i]["level"]; - offer.requirements[i]["side"] = barterScheme[i]["side"]; - } - } - - return offer; - }; - }, - { frequency: "Always" } - ); - // Better tool return - starting production if (config.putToolsBack) { container.afterResolution(