diff --git a/RotationSolver.Basic/Helpers/StatusHelper.cs b/RotationSolver.Basic/Helpers/StatusHelper.cs index f3ba7e730..81fe3dd6d 100644 --- a/RotationSolver.Basic/Helpers/StatusHelper.cs +++ b/RotationSolver.Basic/Helpers/StatusHelper.cs @@ -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; @@ -172,11 +173,20 @@ private static IEnumerable GetStatus(this BattleChara obj, bool isFromSe private static IEnumerable GetAllStatus(this BattleChara obj, bool isFromSelf) { - if (obj == null) return Array.Empty(); + try + { + if (obj == null) return Array.Empty(); + if (obj.StatusList == null) return Array.Empty(); - 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(); + } } /// diff --git a/RotationSolver/Updaters/MajorUpdater.cs b/RotationSolver/Updaters/MajorUpdater.cs index e92aa813d..d4ffb1732 100644 --- a/RotationSolver/Updaters/MajorUpdater.cs +++ b/RotationSolver/Updaters/MajorUpdater.cs @@ -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;