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

Commit

Permalink
fix: add duty action on slot check.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 8, 2023
1 parent 2adc575 commit 793df6b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
Target = player;

if (!SkipDisable && !IsEnabled) return false;
if (IsDutyAction && !IsDutyActionOnSlot) return false;

if (DataCenter.DisabledAction != null && DataCenter.DisabledAction.Contains(ID)) return false;

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public partial class BaseAction : IBaseAction
/// <summary>
/// Is this duty action on the slot.
/// </summary>
public bool IsDutyActionOnSlot => ActionManager.GetDutyActionId(0) == AdjustedID || ActionManager.GetDutyActionId(1) == AdjustedID;
public bool IsDutyActionOnSlot => DataCenter.BluSlots.Contains(AdjustedID);

/// <summary>
/// How many gcd left to add the dot.
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public static float AbilityRemain
public static float CastingTotal { get; internal set; }
#endregion
public static uint[] BluSlots { get; internal set; } = new uint[24];
public static uint[] DutyActions { get; internal set; } = new uint[2];

static DateTime _specialStateStartTime = DateTime.MinValue;
private static double SpecialTimeElapsed => (DateTime.Now - _specialStateStartTime).TotalSeconds;
Expand Down
8 changes: 6 additions & 2 deletions RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,20 @@ internal unsafe static void UpdateActionInfo()
SetAction(NextGCDAction?.AdjustedID ?? 0);
UpdateWeaponTime();
UpdateCombatTime();
UpdateBluSlots();
UpdateSlots();
UpdateMoving();
UpdateMPTimer();
}
private unsafe static void UpdateBluSlots()
private unsafe static void UpdateSlots()
{
for (int i = 0; i < DataCenter.BluSlots.Length; i++)
{
DataCenter.BluSlots[i] = ActionManager.Instance()->GetActiveBlueMageActionInSlot(i);
}
for (ushort i = 0; i < DataCenter.DutyActions.Length; i++)
{
DataCenter.DutyActions[i] = ActionManager.GetDutyActionId(i);
}
}

static DateTime _stopMovingTime = DateTime.MinValue;
Expand Down

0 comments on commit 793df6b

Please sign in to comment.