From 8693dc3d3d83ca40b223050d9c3d27ca164d541a Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 12 Jul 2017 17:53:07 +0300 Subject: [PATCH] Fixed AI crew members swimming too fast, reduced max swimming speed (= the speed when holding shift) --- .../BarotraumaShared/Content/Characters/Human/human.xml | 2 +- .../Source/Characters/AI/HumanAIController.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Content/Characters/Human/human.xml b/Barotrauma/BarotraumaShared/Content/Characters/Human/human.xml index 1d45173db..4afd2b268 100644 --- a/Barotrauma/BarotraumaShared/Content/Characters/Human/human.xml +++ b/Barotrauma/BarotraumaShared/Content/Characters/Human/human.xml @@ -10,7 +10,7 @@ legtorque="15.0" thightorque="-5.0" walkspeed="1.5" swimspeed="2.0" - runspeedmultiplier="3.0" swimspeedmultiplier="1.5" + runspeedmultiplier="3.0" swimspeedmultiplier="1.2" colliderheightfromfloor="55" impacttolerance="7.5"> diff --git a/Barotrauma/BarotraumaShared/Source/Characters/AI/HumanAIController.cs b/Barotrauma/BarotraumaShared/Source/Characters/AI/HumanAIController.cs index 416e96c99..b0f72b2b4 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/AI/HumanAIController.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/AI/HumanAIController.cs @@ -62,7 +62,12 @@ namespace Barotrauma objectiveManager.DoCurrentObjective(deltaTime); float currObjectivePriority = objectiveManager.GetCurrentPriority(Character); - float moveSpeed = MathHelper.Clamp(currObjectivePriority/10.0f, 1.0f, 3.0f); + float moveSpeed = 1.0f; + + if (currObjectivePriority > 30.0f) + { + moveSpeed *= Character.AnimController.InWater ? Character.AnimController.SwimSpeedMultiplier : Character.AnimController.RunSpeedMultiplier; + } steeringManager.Update(moveSpeed);