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

Commit

Permalink
login ctd potential fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Dec 11, 2023
1 parent 166ae81 commit c5dc294
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
18 changes: 14 additions & 4 deletions RotationSolver.Basic/Helpers/StatusHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dalamud.Game.ClientState.Statuses;
using ECommons.Automation;
using ECommons.DalamudServices;
using ECommons.ExcelServices;
using ECommons.GameHelpers;
using RotationSolver.Basic.Configuration;
Expand Down Expand Up @@ -172,11 +173,20 @@ private static IEnumerable<Status> GetStatus(this BattleChara obj, bool isFromSe

private static IEnumerable<Status> GetAllStatus(this BattleChara obj, bool isFromSelf)
{
if (obj == null) return Array.Empty<Status>();
try
{
if (obj == null) return Array.Empty<Status>();
if (obj.StatusList == null) return Array.Empty<Status>();

return obj.StatusList.Where(status => !isFromSelf
|| status.SourceId == Player.Object.ObjectId
|| status.SourceObject?.OwnerId == Player.Object.ObjectId);
return obj.StatusList.Where(status => !isFromSelf
|| status.SourceId == Player.Object.ObjectId
|| status.SourceObject?.OwnerId == Player.Object.ObjectId);
}
catch (Exception ex)
{
Svc.Log.Error($"Failed to {nameof(GetAllStatus)}", ex);
return Array.Empty<Status>();
}
}

/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions RotationSolver/Updaters/MajorUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ namespace RotationSolver.Updaters;

internal static class MajorUpdater
{
public static bool IsValid => Svc.Condition.Any()
public static unsafe bool IsValid => Svc.Condition.Any()
&& !Svc.Condition[ConditionFlag.BetweenAreas]
&& !Svc.Condition[ConditionFlag.BetweenAreas51]
&& Player.Available;
&& Player.Available
&& Player.Interactable;

static bool _showedWarning, _work;
static Exception _threadException;
Expand Down

0 comments on commit c5dc294

Please sign in to comment.