(9bd8db487) Allow to aim in ladders when not moving.

This commit is contained in:
Joonas Rikkonen
2019-04-02 12:41:18 +03:00
parent 7d8b489319
commit e86d86c41f
9 changed files with 49 additions and 46 deletions
@@ -303,10 +303,8 @@ namespace Barotrauma.Items.Components
// Too close -> steer away
character.AIController.SteeringManager.SteeringManual(deltaTime, Vector2.Normalize(character.SimPosition - leak.SimPosition) / 2);
}
else if (!character.IsClimbing)
else
{
// Close enough -> stop if not in ladders.
// In ladders, we most likely want to move back and forth, because we cannot aim -> if the leak is on the side, it should get fixed.
character.AIController.SteeringManager.Reset();
}
}
@@ -317,7 +315,7 @@ namespace Barotrauma.Items.Components
// Press the trigger only when the tool is approximately facing the target.
// If the character is climbing, ignore the check, because we cannot aim while climbing.
if (character.IsClimbing || VectorExtensions.Angle(VectorExtensions.Forward(item.body.TransformedRotation), fromItemToLeak) < MathHelper.PiOver4)
if (VectorExtensions.Angle(VectorExtensions.Forward(item.body.TransformedRotation), fromItemToLeak) < MathHelper.PiOver4)
{
Use(deltaTime, character);
}