From 44d87613b91583e7f035b1cfe633c3b010f13ce9 Mon Sep 17 00:00:00 2001 From: Regalis Date: Sun, 13 Nov 2016 21:13:18 +0200 Subject: [PATCH] - setting SelectedConstruction back to null if a client is too far from it (-> selecting items doesn't become impossible after selecting a cabinet/reactor/whatever and moving away from it) - closestItem or closestCharacter aren't checked unless the client pressed Select --- Subsurface/Source/Characters/Character.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index a5a164129..fc755a550 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -1417,17 +1417,19 @@ namespace Barotrauma { Control(deltaTime, cam); } - + + if (selectedConstruction != null && !selectedConstruction.IsInPickRange(WorldPosition)) + { + selectedConstruction = null; + } + if (controlled != this && !(this is AICharacter)) { - Vector2 mouseSimPos = ConvertUnits.ToSimUnits(cursorPosition); - if (!LockHands) { - //find the closest item if selectkey has been hit, or if the Character is being - //controlled by the player (in order to highlight it) + Vector2 mouseSimPos = ConvertUnits.ToSimUnits(cursorPosition); - if (findClosestTimer <= 0.0f || IsKeyHit(InputType.Select)) + if (IsKeyHit(InputType.Select)) { closestCharacter = FindClosestCharacter(mouseSimPos); if (closestCharacter != null && closestCharacter.info == null)