Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds check to prevent spamming of unlearned abilities #80

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions RotationSolver.Basic/Actions/BaseAction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game;
using Action = Lumina.Excel.GeneratedSheets.Action;
Expand Down Expand Up @@ -156,10 +157,20 @@ public bool CanUse(out IAction act, bool skipStatusProvideCheck = false, bool sk
{
Target = PreviewTarget.Value;
}
if (!CanUseActionOnTarget(PreviewTarget.Value)) return false;

return true;
}

private unsafe bool CanUseActionOnTarget(TargetResult value)
{
var target = value.Target;
if (target == null) return false;

var canUseOnTarget = ActionManager.CanUseActionOnTarget(AdjustedID, target.GameObject());
return canUseOnTarget;
}

/// <inheritdoc/>
public bool CanUse(out IAction act, CanUseOption option, byte gcdCountForAbility = 0)
{
Expand Down