Skip equipping recommended gear if already in combat

This commit is contained in:
Liza 2024-11-28 23:27:55 +01:00
parent 3d9a1cec7c
commit d9d090e980
Signed by: liza
GPG Key ID: 8DD6D21C03BB0848

View File

@ -1,4 +1,5 @@
using System; using System;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.UI.Misc; using FFXIVClientStructs.FFXIV.Client.UI.Misc;
@ -39,12 +40,15 @@ internal static class EquipRecommended
public override string ToString() => "EquipRecommended"; public override string ToString() => "EquipRecommended";
} }
internal sealed unsafe class DoEquipRecommended(IClientState clientState, IChatGui chatGui) : TaskExecutor<EquipTask> internal sealed unsafe class DoEquipRecommended(IClientState clientState, IChatGui chatGui, ICondition condition) : TaskExecutor<EquipTask>
{ {
private bool _equipped; private bool _equipped;
protected override bool Start() protected override bool Start()
{ {
if (condition[ConditionFlag.InCombat])
return false;
RecommendEquipModule.Instance()->SetupForClassJob((byte)clientState.LocalPlayer!.ClassJob.RowId); RecommendEquipModule.Instance()->SetupForClassJob((byte)clientState.LocalPlayer!.ClassJob.RowId);
return true; return true;
} }