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

Commit

Permalink
Merge pull request ArchiDog1998#538 from ChrisMellor/aliiance-party
Browse files Browse the repository at this point in the history
Alliance Party fix
  • Loading branch information
LTS-FFXIV committed Dec 2, 2023
2 parents 0892e45 + b88c4a6 commit 77838fd
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions RotationSolver/Updaters/TargetUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Objects.SubKinds;
using ECommons.DalamudServices;
using ECommons.ExcelServices;
using ECommons.GameFunctions;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.UI;
using Lumina.Excel.GeneratedSheets;
using RotationSolver.Basic.Configuration;
using RotationSolver.Helpers;
using System.Configuration;
using System.Text.RegularExpressions;
using Action = Lumina.Excel.GeneratedSheets.Action;

Expand Down Expand Up @@ -407,21 +405,27 @@ private static void MaintainDeathPeople(ref IEnumerable<BattleChara> deathAll, r
SortedDictionary<uint, Vector3> locs = new();
foreach (var item in deathAll)
{
if (item is null) continue;
locs[item.ObjectId] = item.Position;
}
foreach (var item in deathParty)
{
if (item is null) continue;
locs[item.ObjectId] = item.Position;
}

deathAll = FilterForDeath(deathAll);
deathParty = FilterForDeath(deathParty);

if (deathAll is not null)
{
deathAll = FilterForDeath(deathAll);
}
if (deathParty is not null)
{
deathParty = FilterForDeath(deathParty);
}
_locations = locs;
}

private static IEnumerable<BattleChara> FilterForDeath(IEnumerable<BattleChara> battleCharas)
=> battleCharas.Where(b =>
=> battleCharas?.Where(b =>
{
if (!_locations.TryGetValue(b.ObjectId, out var loc)) return false;
Expand All @@ -436,12 +440,12 @@ private static IEnumerable<BattleChara> FilterForDeath(IEnumerable<BattleChara>
_healDelay4 = new(GetHealRange);
static void UpdateCanHeal(PlayerCharacter player)
{
var singleAbility = ShouldHealSingle(StatusHelper.SingleHots,
var singleAbility = ShouldHealSingle(StatusHelper.SingleHots,
Service.Config.GetValue(JobConfigFloat.HealthSingleAbility),
Service.Config.GetValue(JobConfigFloat.HealthSingleAbilityHot));

var singleSpell = ShouldHealSingle(StatusHelper.SingleHots,
Service.Config.GetValue(JobConfigFloat.HealthSingleSpell),
Service.Config.GetValue(JobConfigFloat.HealthSingleSpell),
Service.Config.GetValue(JobConfigFloat.HealthSingleSpellHot));

var onlyHealSelf = Service.Config.GetValue(PluginConfigBool.OnlyHealSelfWhenNoHealer) && player.ClassJob.GameData?.GetJobRole() != JobRole.Healer;
Expand All @@ -452,7 +456,7 @@ static void UpdateCanHeal(PlayerCharacter player)
: singleAbility > 0;

DataCenter.CanHealSingleSpell = onlyHealSelf ? ShouldHealSingle(Svc.ClientState.LocalPlayer, StatusHelper.SingleHots, Service.Config.GetValue(JobConfigFloat.HealthSingleSpell),
Service.Config.GetValue(JobConfigFloat.HealthSingleSpellHot))
Service.Config.GetValue(JobConfigFloat.HealthSingleSpellHot))
: singleSpell > 0;

DataCenter.CanHealAreaAbility = singleAbility > 2;
Expand Down

0 comments on commit 77838fd

Please sign in to comment.