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

Commit

Permalink
fix: fixed target.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Oct 4, 2023
1 parent 7d653fa commit 73f101b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Resources/DangerousStatus.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
1345,
1346,
1348,
2965
2965,
3364
]
23 changes: 22 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,5 +399,26 @@
10094,
28973,
6622,
25648
25648,
34782,
34813,
34822,
35011,
35905,
35587,
35618,
35034,
35033,
35015,
34827,
34841,
34833,
36026,
35217,
35240,
35375,
35385,
36093,
35420,
36091
]
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ClickingCount": 11783,
"ClickingCount": 12170,
"SaidUsers": []
}
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,11 @@ private bool TargetParty(float range, int aoeCount, bool mustUse, out BattleChar
availableCharas = availableCharas.Where(b => b.IsJobCategory(JobRole.Tank));
}
availableCharas = TargetFilter.GetObjectInRadius(availableCharas, range).Where(CanUseTo);
if (availableCharas == null || !availableCharas.Any())
{
target = null;
return false;
}

target = ChoiceTarget(availableCharas, mustUse);
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public enum PluginConfigFloat : byte

[Default(0.5f, 0f, 3f)] CountdownDelayMin,
[Default(1f)] CountdownDelayMax,
[Default(0.6f, 0f, 0.7f)] CountDownAhead,
[Default(0.4f, 0f, 0.7f)] CountDownAhead,

[Default(24f, 0f, 90f)] MoveTargetAngle,
[Default(60f, 10f, 1800f)] BossTimeToKill,
Expand Down
19 changes: 14 additions & 5 deletions RotationSolver.Basic/Configuration/MacroInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using ECommons.DalamudServices;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;

namespace RotationSolver.Basic.Configuration;
#pragma warning disable CS1591 // Missing XML comment for publicly visible
Expand All @@ -17,11 +18,19 @@ public unsafe bool AddMacro(GameObject tar = null)
{
if (MacroIndex < 0 || MacroIndex > 99) return false;

var shared = RaptureMacroModule.Instance()->SharedSpan[MacroIndex];
var individual = RaptureMacroModule.Instance()->IndividualSpan[MacroIndex];
try
{
var shared = RaptureMacroModule.Instance()->SharedSpan[MacroIndex];
var individual = RaptureMacroModule.Instance()->IndividualSpan[MacroIndex];

DataCenter.Macros.Enqueue(new MacroItem(tar, IsShared ? &shared : &individual));
return true;
DataCenter.Macros.Enqueue(new MacroItem(tar, IsShared ? &shared : &individual));
return true;
}
catch (Exception ex)
{
Svc.Log.Warning(ex, "Failed to add macro.");
return false;
}
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible

0 comments on commit 73f101b

Please sign in to comment.