From c80a3d1d5de2af0cb93120a27f0654899abb6593 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 29 Mar 2019 17:26:54 +0200 Subject: [PATCH] (11190239d) Fixed autointeracting with contained items causing the parent to be selected in MP (e.g. picking up an ammunition box by interacting with the loader caused the loader to be selected) --- Barotrauma/BarotraumaShared/Source/Characters/Character.cs | 1 + .../BarotraumaShared/Source/Items/Components/ItemContainer.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs index 8993574a8..601753c05 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs @@ -468,6 +468,7 @@ namespace Barotrauma public Item FocusedItem { get { return focusedItem; } + set { focusedItem = value; } } public Item PickingItem diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/ItemContainer.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/ItemContainer.cs index aac7bf9df..d9abe0511 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/ItemContainer.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/ItemContainer.cs @@ -162,6 +162,7 @@ namespace Barotrauma.Items.Components if (contained == null) continue; if (contained.TryInteract(character)) { + character.FocusedItem = contained; return false; } } @@ -178,6 +179,7 @@ namespace Barotrauma.Items.Components if (contained == null) continue; if (contained.TryInteract(picker)) { + picker.FocusedItem = contained; return true; } }