From c624ff2c8c4b823f256bf8a9ae44fc76b8a6fee4 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 2 Mar 2018 18:04:01 +0200 Subject: [PATCH] Hopefully fixed clients forcing other players to pick items when the clients actually selected them (e29655c) without breaking AI interactions with items --- .../BarotraumaShared/Source/Items/Item.cs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index 53d7bf7e8..a1d078fce 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -1086,21 +1086,8 @@ namespace Barotrauma } else { - if (forceSelectKey && ic.CanBeSelected) - { - if (ic.PickKey == InputType.Select) pickHit = true; - if (ic.SelectKey == InputType.Select) selectHit = true; - } - else if (forceActionKey) - { - if (ic.PickKey == InputType.Use) pickHit = true; - if (ic.SelectKey == InputType.Use) selectHit = true; - } - else - { - pickHit = picker.IsKeyHit(ic.PickKey); - selectHit = picker.IsKeyHit(ic.SelectKey); - } + pickHit = (forceActionKey && ic.CanBePicked) || picker.IsKeyHit(ic.PickKey); + selectHit = (forceSelectKey && ic.CanBeSelected) || picker.IsKeyHit(ic.SelectKey); } if (!pickHit && !selectHit) continue;