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

Commit

Permalink
fix: marking targeting bug fixed, maybe.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 25, 2023
1 parent 6ed0e09 commit 2e67d3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
3 changes: 2 additions & 1 deletion RotationSolver/Actions/BaseAction/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ private bool CheckStatus(BattleChara tar)
/// 开启攻击标记且有攻击标记目标且不开AOE。
/// </summary>
private static bool NoAOEForAttackMark =>
Service.Configuration.ChooseAttackMark && !Service.Configuration.CanAttackMarkAOE
Service.Configuration.ChooseAttackMark
&& !Service.Configuration.CanAttackMarkAOE
&& MarkingHelper.HaveAttackChara(TargetUpdater.HostileTargets);
}
18 changes: 2 additions & 16 deletions RotationSolver/Data/MarkingController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dalamud.Game.ClientState.Objects.Types;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using RotationSolver.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -8,21 +9,6 @@ namespace RotationSolver.Data;

public struct MarkingHelper
{
//public static long Attack1 => GetMarker(0);
//public static long Attack2 => GetMarker(1);
//public static long Attack3 => GetMarker(2);
//public static long Attack4 => GetMarker(3);
//public static long Attack5 => GetMarker(4);
//public static long Bind1 => GetMarker(5);
//public static long Bind2 => GetMarker(6);
//public static long Bind3 => GetMarker(7);
//public static long Stop1 => GetMarker(8);
//public static long Stop2 => GetMarker(9);
//public static long Square => GetMarker(10);
//public static long Circle => GetMarker(11);
//public static long Cross => GetMarker(12);
//public static long Triangle => GetMarker(13);

private unsafe static long GetMarker(uint index) => MarkingController.Instance()->MarkerArray[index];


Expand All @@ -33,7 +19,7 @@ internal static BattleChara GetAttackMarkChara(IEnumerable<BattleChara> charas)
for (uint i = 0; i < 5; i++)
{
var b = GetChara(charas, GetMarker(i));
if (b != null) return b;
if (b != null && b.CurrentHp > 0 && b.CanAttack()) return b;
}
return null;
}
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Helpers/TargetFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ internal static BattleChara DefaultFindHostile(IEnumerable<BattleChara> availabl
if (availableCharas == null || !availableCharas.Any()) return null;

//找到被标记攻击的怪
if (MarkingHelper.GetAttackMarkChara(availableCharas) is BattleChara b && b != null) return b;
if (Service.Configuration.ChooseAttackMark &&
MarkingHelper.GetAttackMarkChara(availableCharas) is BattleChara b && b != null) return b;

//去掉停止标记的怪
if (Service.Configuration.FilterStopMark)
Expand Down

0 comments on commit 2e67d3c

Please sign in to comment.