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

Commit

Permalink
fix: fix with fateManager..GOD!
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 25, 2023
1 parent a74bfea commit 6ba62e4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions RotationSolver/Updaters/TargetUpdater_Hostile.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Logging;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.Fate;
using FFXIVClientStructs.FFXIV.Client.UI;
Expand Down Expand Up @@ -36,11 +37,26 @@ internal static partial class TargetUpdater

internal static bool IsHostileCastingToTank { get; private set; } = false;


internal static unsafe bool Infate
{
get
{
try
{
return Service.Configuration.ChangeTargetForFate && (IntPtr)FateManager.Instance() != IntPtr.Zero && FateManager.Instance()->FateJoined > 0
&& Service.ClientState.LocalPlayer.Level <= FateManager.Instance()->CurrentFate->MaxLevel;
}
catch(Exception ex)
{
PluginLog.Error(ex.StackTrace);
return false;
}
}
}

internal unsafe static void UpdateHostileTargets()
{
var inFate = Service.Configuration.ChangeTargetForFate && (IntPtr)FateManager.Instance() != IntPtr.Zero && FateManager.Instance()->FateJoined > 0;
var inFate = Infate;

AllTargets = TargetFilter.GetTargetable(TargetFilter.GetObjectInRadius(Service.ObjectTable, 30).Where(obj =>
{
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Windows/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private unsafe void DrawDebugTab()
ImGui.Text("Friends: " + TargetUpdater.PartyMembers.Count().ToString());
if ((IntPtr)FateManager.Instance() != IntPtr.Zero)
{
ImGui.Text("Fate: " + FateManager.Instance()->FateJoined.ToString());
ImGui.Text("Fate: " + TargetUpdater.Infate.ToString());
}

if (ImGui.CollapsingHeader("Status"))
Expand Down

0 comments on commit 6ba62e4

Please sign in to comment.