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

Commit

Permalink
fix: fixed some null bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 4, 2023
1 parent f36cc11 commit 7d2fe93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Helpers/TargetFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ internal static BattleChara DefaultChooseFriend(IEnumerable<BattleChara> availab
var tankTars = availableCharas.GetJobCategory(JobRole.Tank);

var tankTar = tankTars.OrderBy(ObjectHelper.GetHealingRatio).FirstOrDefault();
if (tankTar.GetHealingRatio() < Service.Config.HealthTankRatio) return tankTar;
if (tankTar != null && tankTar.GetHealingRatio() < Service.Config.HealthTankRatio)
return tankTar;

var tar = availableCharas.OrderBy(ObjectHelper.GetHealingRatio).FirstOrDefault();
if (tar.GetHealingRatio() < 1) return tar;
Expand Down
8 changes: 5 additions & 3 deletions RotationSolver/Updaters/PreviewUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ internal static unsafe void PulseActionBar(uint actionID)

private unsafe static bool IsActionSlotRight(ActionBarSlot slot, HotBarSlot* hot, uint actionID)
{
if ((IntPtr)hot == IntPtr.Zero) return false;
if (hot->IconTypeA != HotbarSlotType.CraftAction && hot->IconTypeA != HotbarSlotType.Action) return false;
if (hot->IconTypeB != HotbarSlotType.CraftAction && hot->IconTypeB != HotbarSlotType.Action) return false;
if ((IntPtr)hot != IntPtr.Zero)
{
if (hot->IconTypeA != HotbarSlotType.CraftAction && hot->IconTypeA != HotbarSlotType.Action) return false;
if (hot->IconTypeB != HotbarSlotType.CraftAction && hot->IconTypeB != HotbarSlotType.Action) return false;
}

return Service.GetAdjustedActionId((uint)slot.ActionId) == actionID;
}
Expand Down

0 comments on commit 7d2fe93

Please sign in to comment.