From 73f101bd66f7485f90cf7ddf27a0ce350613fb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Wed, 4 Oct 2023 20:32:07 +0800 Subject: [PATCH] fix: fixed target. --- Resources/DangerousStatus.json | 3 ++- Resources/HostileCastingArea.json | 23 ++++++++++++++++++- Resources/RotationSolverRecord.json | 2 +- .../Actions/BaseAction_Target.cs | 5 ++++ RotationSolver.Basic/Configuration/Configs.cs | 2 +- .../Configuration/MacroInfo.cs | 19 +++++++++++---- 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/Resources/DangerousStatus.json b/Resources/DangerousStatus.json index fbe036279..50e8d304b 100644 --- a/Resources/DangerousStatus.json +++ b/Resources/DangerousStatus.json @@ -20,5 +20,6 @@ 1345, 1346, 1348, - 2965 + 2965, + 3364 ] \ No newline at end of file diff --git a/Resources/HostileCastingArea.json b/Resources/HostileCastingArea.json index a4588e0a3..6b213f0c6 100644 --- a/Resources/HostileCastingArea.json +++ b/Resources/HostileCastingArea.json @@ -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 ] \ No newline at end of file diff --git a/Resources/RotationSolverRecord.json b/Resources/RotationSolverRecord.json index afbd72fe4..742f57787 100644 --- a/Resources/RotationSolverRecord.json +++ b/Resources/RotationSolverRecord.json @@ -1,4 +1,4 @@ { - "ClickingCount": 11783, + "ClickingCount": 12170, "SaidUsers": [] } \ No newline at end of file diff --git a/RotationSolver.Basic/Actions/BaseAction_Target.cs b/RotationSolver.Basic/Actions/BaseAction_Target.cs index 8e1aca1a7..162353c26 100644 --- a/RotationSolver.Basic/Actions/BaseAction_Target.cs +++ b/RotationSolver.Basic/Actions/BaseAction_Target.cs @@ -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); } diff --git a/RotationSolver.Basic/Configuration/Configs.cs b/RotationSolver.Basic/Configuration/Configs.cs index a117dbb46..e8a86dc5c 100644 --- a/RotationSolver.Basic/Configuration/Configs.cs +++ b/RotationSolver.Basic/Configuration/Configs.cs @@ -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, diff --git a/RotationSolver.Basic/Configuration/MacroInfo.cs b/RotationSolver.Basic/Configuration/MacroInfo.cs index 86d337451..5525119cb 100644 --- a/RotationSolver.Basic/Configuration/MacroInfo.cs +++ b/RotationSolver.Basic/Configuration/MacroInfo.cs @@ -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 @@ -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 \ No newline at end of file