From 9ee4e79ee211ffe59a7f2bbb7b6dd003ccbfe42b Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Sun, 19 May 2024 14:28:01 -0700 Subject: [PATCH] Block swap in scav inventory on post-raid transfer screen --- Patches/ProductionPatch.cs | 2 +- Patches/SwapPatch.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Patches/ProductionPatch.cs b/Patches/ProductionPatch.cs index 06f6e33..f9eb819 100644 --- a/Patches/ProductionPatch.cs +++ b/Patches/ProductionPatch.cs @@ -114,7 +114,7 @@ namespace UIFixes } } - // method_9 activates/decactives the product game objects based on the search. Need to resort the list due to above patch + // method_9 activates/deactivates the product game objects based on the search. Need to resort the list due to above patch public class OnSearchChangePatch : ModulePatch { protected override MethodBase GetTargetMethod() diff --git a/Patches/SwapPatch.cs b/Patches/SwapPatch.cs index de28a0a..71fe946 100644 --- a/Patches/SwapPatch.cs +++ b/Patches/SwapPatch.cs @@ -99,6 +99,15 @@ namespace UIFixes return false; } + // TODO: Remove in 3.9.0 when server bug is fixed + // If on the scav inventory screen (aka post-raid scav transfer), swap must be blocked not only between the scav inventory and the stash (normally blocked anyway), + // but even within the scav inventory itself, due to the server not handling it. + if ((itemContext.ViewType == EItemViewType.ScavInventory || targetItemContext.ViewType == EItemViewType.ScavInventory) + && (itemContext.Item.Owner.ID != PatchConstants.BackEndSession.Profile.Id || targetItemContext.Item.Owner.ID != PatchConstants.BackEndSession.Profile.Id)) + { + return false; + } + if (itemContext.Item == targetItemContext.Item || targetItemContext.Item.GetAllParentItems().Contains(itemContext.Item)) { return false;