diff --git a/RotationSolver.Basic/DataCenter.cs b/RotationSolver.Basic/DataCenter.cs index 19449ae57..e7045bd6d 100644 --- a/RotationSolver.Basic/DataCenter.cs +++ b/RotationSolver.Basic/DataCenter.cs @@ -373,6 +373,13 @@ public static unsafe void AddActionRec(Action act) _actions.Enqueue(new ActionRec(_timeLastActionUsed, act)); } + public static void ResetAllLastActions() + { + LastAction = 0; + LastGCD = 0; + LastAbility = 0; + } + public static void AddDamageRec(float damageRatio) { if (_damages.Count >= QUEUECAPACITY) diff --git a/RotationSolver/Updaters/SocialUpdater.cs b/RotationSolver/Updaters/SocialUpdater.cs index 0adb96a7f..0bae1c43e 100644 --- a/RotationSolver/Updaters/SocialUpdater.cs +++ b/RotationSolver/Updaters/SocialUpdater.cs @@ -52,6 +52,7 @@ static bool CanSocial internal static void Enable() { Service.DutyState.DutyStarted += DutyState_DutyStarted; + Service.DutyState.DutyWiped += DutyState_DutyWiped; Service.DutyState.DutyCompleted += DutyState_DutyCompleted; Service.ClientState.TerritoryChanged += ClientState_TerritoryChanged; @@ -127,9 +128,16 @@ static void DutyState_DutyStarted(object sender, ushort e) } } + static void DutyState_DutyWiped(object sender, ushort e) + { + if (Service.Player == null) return; + DataCenter.ResetAllLastActions(); + } + internal static void Disable() { Service.DutyState.DutyStarted -= DutyState_DutyStarted; + Service.DutyState.DutyWiped -= DutyState_DutyWiped; Service.DutyState.DutyCompleted -= DutyState_DutyCompleted; Service.ClientState.TerritoryChanged -= ClientState_TerritoryChanged; }