Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
feat: Add DutyWiped method that resets all IsLastXYZ
Browse files Browse the repository at this point in the history
  • Loading branch information
RiotNOR committed May 14, 2023
1 parent 06ab250 commit e086fed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e086fed

Please sign in to comment.