From a8ec8213823cc91392f37215a410d638f7c904a0 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 8 Aug 2017 21:17:32 +0300 Subject: [PATCH] Handcuffed AICharacters can't climb ladders --- .../Source/Characters/AI/IndoorsSteeringManager.cs | 5 +++-- .../BarotraumaShared/Source/Items/Components/Ladder.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/AI/IndoorsSteeringManager.cs b/Barotrauma/BarotraumaShared/Source/Characters/AI/IndoorsSteeringManager.cs index 1d2f3406e..f841ba9d7 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/AI/IndoorsSteeringManager.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/AI/IndoorsSteeringManager.cs @@ -137,9 +137,10 @@ namespace Barotrauma } - if (currentPath.CurrentNode!= null && currentPath.CurrentNode.Ladders!=null) + if (currentPath.CurrentNode != null && currentPath.CurrentNode.Ladders != null) { - if (character.SelectedConstruction != currentPath.CurrentNode.Ladders.Item && currentPath.CurrentNode.Ladders.Item.IsInsideTrigger(character.WorldPosition)) + if (character.SelectedConstruction != currentPath.CurrentNode.Ladders.Item && + currentPath.CurrentNode.Ladders.Item.IsInsideTrigger(character.WorldPosition)) { currentPath.CurrentNode.Ladders.Item.TryInteract(character, false, true); } diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Ladder.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Ladder.cs index 8347857a2..ad1185f03 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Ladder.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Ladder.cs @@ -12,7 +12,7 @@ namespace Barotrauma.Items.Components public override bool Select(Character character) { - if (character == null) return false; + if (character == null || character.LockHands) return false; character.AnimController.Anim = AnimController.Animation.Climbing; //picker.SelectedConstruction = item;