From d943d2750a56eedaf345a20c36b8a090ddae69a8 Mon Sep 17 00:00:00 2001 From: CWX Date: Fri, 12 Jul 2024 16:29:50 +0100 Subject: [PATCH] add saving of scav profile to end of patch --- .../Patches/ScavMode/FixSavageInventoryScreenPatch.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/project/SPT.SinglePlayer/Patches/ScavMode/FixSavageInventoryScreenPatch.cs b/project/SPT.SinglePlayer/Patches/ScavMode/FixSavageInventoryScreenPatch.cs index f2a4944..3dd4d78 100644 --- a/project/SPT.SinglePlayer/Patches/ScavMode/FixSavageInventoryScreenPatch.cs +++ b/project/SPT.SinglePlayer/Patches/ScavMode/FixSavageInventoryScreenPatch.cs @@ -3,6 +3,7 @@ using HarmonyLib; using SPT.Reflection.Patching; using System.Reflection; using System.Linq; +using SPT.Common.Http; namespace SPT.SinglePlayer.Patches.ScavMode @@ -39,10 +40,12 @@ namespace SPT.SinglePlayer.Patches.ScavMode private static void PatchPrefix(ref ISession ___iSession) { var profile = GetProfileAtEndOfRaidPatch.Profile.ParseJsonTo(); + if (profile.Side != EPlayerSide.Savage) { return; } + var session = (ProfileEndpointFactoryAbstractClass)___iSession; session.AllProfiles = new Profile[] { @@ -50,6 +53,13 @@ namespace SPT.SinglePlayer.Patches.ScavMode profile }; session.ProfileOfPet.UncoverAll(); + + // make a request to the server, so it knows of the items we might transfer + RequestHandler.PutJson("/raid/profile/scavsave", new + { + profile = session.ProfileOfPet + } + .ToJson()); } } }