From 902e5e4493089643edbb8a5d48b13609fe57ab9a Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 29 Mar 2019 17:26:40 +0200 Subject: [PATCH] (797046bbf) Fixed deselecting an item with Esc/E causing the character to interact with whatever the cursor is focused on. TODO: Fix autointeracting causing entities to be selected in MP (e.g. picking up an ammunition box by interacting with the loader causes the loader to be selected) --- .../BarotraumaClient/Source/Characters/Character.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Character.cs b/Barotrauma/BarotraumaClient/Source/Characters/Character.cs index 7fab0116d..79abaed11 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/Character.cs @@ -226,8 +226,15 @@ namespace Barotrauma if (SelectedConstruction != null && SelectedConstruction.ActiveHUDs.Any(ic => ic.GuiFrame != null && HUD.CloseHUD(ic.GuiFrame.Rect))) { - //emulate a Select input to get the character to deselect the item server-side - keys[(int)InputType.Select].Hit = true; + if (GameMain.Client != null) + { + //emulate a Select input to get the character to deselect the item server-side + keys[(int)InputType.Select].Hit = true; + } + //reset focus to prevent us from accidentally interacting with another entity + focusedItem = null; + focusedCharacter = null; + findFocusedTimer = 0.2f; SelectedConstruction = null; }