diff --git a/Core/GoalsComponent/CombatUtil.cs b/Core/GoalsComponent/CombatUtil.cs index 856c21da..78af5860 100644 --- a/Core/GoalsComponent/CombatUtil.cs +++ b/Core/GoalsComponent/CombatUtil.cs @@ -60,11 +60,13 @@ public bool AcquiredTarget(int maxTimeMs = 400) if (playerReader.PetTarget()) { input.PressTargetPet(); + wait.Update(); Log($"Pets target {playerReader.TargetTarget}"); if (playerReader.TargetTarget == UnitsTarget.PetHasATarget) { Log($"{nameof(AcquiredTarget)}: Found target by pet"); input.PressTargetOfTarget(); + wait.Update(); return true; } } diff --git a/Core/GoalsComponent/StopMoving.cs b/Core/GoalsComponent/StopMoving.cs index b0e5552a..30292c26 100644 --- a/Core/GoalsComponent/StopMoving.cs +++ b/Core/GoalsComponent/StopMoving.cs @@ -64,24 +64,24 @@ public void StopForward() public void StopTurn() { - if (direction != playerReader.Direction) + if (direction == playerReader.Direction) + return; + + bool pressedAny = false; + + if (input.IsKeyDown(input.TurnLeftKey)) { - bool pressedAny = false; - - if (input.IsKeyDown(input.TurnLeftKey)) - { - input.SetKeyState(input.TurnLeftKey, false, true); - pressedAny = true; - } - else if (input.IsKeyDown(input.TurnRightKey)) - { - input.SetKeyState(input.TurnRightKey, false, true); - pressedAny = true; - } - - if (pressedAny) - token.WaitHandle.WaitOne(1); + input.SetKeyState(input.TurnLeftKey, false, true); + pressedAny = true; } + else if (input.IsKeyDown(input.TurnRightKey)) + { + input.SetKeyState(input.TurnRightKey, false, true); + pressedAny = true; + } + + if (pressedAny) + token.WaitHandle.WaitOne(1); direction = playerReader.Direction; }