From b0278d9ff8fd02a67cf85cd9f5514efeabe69aea Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 19 Feb 2022 13:50:56 +0100 Subject: [PATCH] fix(combat): reset attack command if new target is different --- Extensions/NosSmooth.Extensions.Combat/CombatManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Extensions/NosSmooth.Extensions.Combat/CombatManager.cs b/Extensions/NosSmooth.Extensions.Combat/CombatManager.cs index 173e92b..a9078e8 100644 --- a/Extensions/NosSmooth.Extensions.Combat/CombatManager.cs +++ b/Extensions/NosSmooth.Extensions.Combat/CombatManager.cs @@ -23,6 +23,7 @@ public class CombatManager : IStatefulEntity private readonly SemaphoreSlim _semaphore; private readonly INostaleClient _client; private readonly Game.Game _game; + private bool _cancelling; /// /// Initializes a new instance of the class. @@ -79,6 +80,11 @@ public class CombatManager : IStatefulEntity previousTarget = currentTarget; currentTarget = stepResult.Entity; + if (previousTarget != currentTarget) + { + continue; + } + operation = combatState.NextOperation(); } -- 2.49.0