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

Commit

Permalink
fix: fixed the cooldown check for item use.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 18, 2023
1 parent ec7dd73 commit 47a8877
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public unsafe bool CanUse(out IAction item)

var remain = RecastTimeOneCharge - RecastTimeElapsed;

if (!CooldownHelper.RecastAfter(DataCenter.AbilityRemain, remain, false)) return false;
if (CooldownHelper.RecastAfter(DataCenter.AbilityRemain, remain, false)) return false;

if (OtherCheck != null && !OtherCheck()) return false;

Expand Down
9 changes: 6 additions & 3 deletions RotationSolver/UI/ImGuiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,14 @@ private unsafe static void Display(this IBaseAction action, bool IsActive) => ac
{
#if DEBUG
ImGui.Text("Is Real GCD: " + action.IsRealGCD.ToString());
ImGui.Text("Has One:" + action.HasOneCharge.ToString());
ImGui.Text("Recast One: " + action.RecastTimeOneCharge.ToString());
ImGui.Text("Recast Elapsed: " + action.RecastTimeElapsed.ToString());
ImGui.Text("Status: " + ActionManager.Instance()->GetActionStatus(ActionType.Spell, action.AdjustedID).ToString());
ImGui.Text("Cast Time: " + action.CastTime.ToString());
ImGui.Text("MP: " + action.MPNeed.ToString());
#endif
ImGui.Text("Has One:" + action.HasOneCharge.ToString());
ImGui.Text("Recast One: " + action.RecastTimeOneCharge.ToString());
ImGui.Text("Recast Elapsed: " + action.RecastTimeElapsed.ToString());

var option = CanUseOption.IgnoreTarget;
ImGui.Text($"Can Use: {action.CanUse(out _, option)} ");
ImGui.Text("Must Use:" + action.CanUse(out _, option | CanUseOption.MustUse).ToString());
Expand Down Expand Up @@ -653,8 +654,10 @@ public unsafe static void Display(this IBaseItem item, bool IsActive) => item.Dr
if (Service.Config.InDebug)
{
ImGui.Text("Status: " + ActionManager.Instance()->GetActionStatus(ActionType.Item, item.ID).ToString());
ImGui.Text("Status: " + ActionManager.Instance()->GetActionStatus(ActionType.Item, item.ID + 1000000).ToString());
var remain = ActionManager.Instance()->GetRecastTime(ActionType.Item, item.ID) - ActionManager.Instance()->GetRecastTimeElapsed(ActionType.Item, item.ID);
ImGui.Text("remain: " + remain.ToString());
ImGui.Text("CanUse: " + item.CanUse(out _).ToString());
}
});
#endregion
Expand Down

0 comments on commit 47a8877

Please sign in to comment.