From 5275d62dd525121ddff25a2fcff1ec095303b4a2 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Tue, 9 Apr 2024 23:45:06 +0200 Subject: [PATCH] Prevent automatic plugin updates during Duties (#1759) --- Dalamud/Game/ChatHandlers.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dalamud/Game/ChatHandlers.cs b/Dalamud/Game/ChatHandlers.cs index 5dd6ed3ba..3b972146a 100644 --- a/Dalamud/Game/ChatHandlers.cs +++ b/Dalamud/Game/ChatHandlers.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using CheapLoc; using Dalamud.Configuration.Internal; +using Dalamud.Game.ClientState.Conditions; using Dalamud.Game.Gui; using Dalamud.Game.Text; using Dalamud.Game.Text.SeStringHandling; @@ -290,13 +291,20 @@ internal class ChatHandlers : IServiceType var chatGui = Service.GetNullable(); var pluginManager = Service.GetNullable(); var notifications = Service.GetNullable(); + var condition = Service.GetNullable(); - if (chatGui == null || pluginManager == null || notifications == null) + if (chatGui == null || pluginManager == null || notifications == null || condition == null) { Log.Warning("Aborting auto-update because a required service was not loaded."); return false; } + if (condition.Any(ConditionFlag.BoundByDuty, ConditionFlag.BoundByDuty56, ConditionFlag.BoundByDuty95)) + { + Log.Warning("Aborting auto-update because the player is in a duty."); + return false; + } + if (!pluginManager.ReposReady || !pluginManager.InstalledPlugins.Any() || !pluginManager.AvailablePlugins.Any()) { // Plugins aren't ready yet.