From d0eb5f0e69f03815ae4e380efe95b251a8307585 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Wed, 30 Nov 2022 11:37:34 +0100 Subject: [PATCH] Ensure new deep dungeon data in 6.35 is only processed when enabled on both server & client --- Pal.Client/Plugin.cs | 10 +++++++--- Pal.Client/Windows/ConfigWindow.cs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Pal.Client/Plugin.cs b/Pal.Client/Plugin.cs index 1fa0c0a..8052825 100644 --- a/Pal.Client/Plugin.cs +++ b/Pal.Client/Plugin.cs @@ -13,6 +13,7 @@ using Grpc.Core; using ImGuiNET; using Lumina.Excel.GeneratedSheets; using Pal.Client.Windows; +using Pal.Common; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -243,7 +244,7 @@ namespace Pal.Client LastTerritory = Service.ClientState.TerritoryType; TerritorySyncState = SyncState.NotAttempted; - if (IsInPotdOrHoh()) + if (IsInDeepDungeon()) FloorMarkers[LastTerritory] = LocalState.Load(LastTerritory) ?? new LocalState(LastTerritory); EphemeralMarkers.Clear(); PomanderOfSight = PomanderState.Inactive; @@ -252,7 +253,7 @@ namespace Pal.Client DebugMessage = null; } - if (!IsInPotdOrHoh()) + if (!IsInDeepDungeon()) return; if (Service.Configuration.Mode == Configuration.EMode.Online && TerritorySyncState == SyncState.NotAttempted) @@ -650,7 +651,10 @@ namespace Pal.Client return result; } - internal bool IsInPotdOrHoh() => Service.ClientState.IsLoggedIn && Service.Condition[ConditionFlag.InDeepDungeon]; + internal bool IsInDeepDungeon() => + Service.ClientState.IsLoggedIn + && Service.Condition[ConditionFlag.InDeepDungeon] + && typeof(ETerritoryType).IsEnumDefined(Service.ClientState.TerritoryType); internal static Element CreateSplatoonElement(Marker.EType type, Vector3 pos, Vector4 color, bool fill = false) => CreateSplatoonElement(type, pos, ImGui.ColorConvertFloat4ToU32(color), fill); diff --git a/Pal.Client/Windows/ConfigWindow.cs b/Pal.Client/Windows/ConfigWindow.cs index 5b480a2..8dd4306 100644 --- a/Pal.Client/Windows/ConfigWindow.cs +++ b/Pal.Client/Windows/ConfigWindow.cs @@ -152,7 +152,7 @@ namespace Pal.Client.Windows if (ImGui.BeginTabItem("Debug")) { var plugin = Service.Plugin; - if (plugin.IsInPotdOrHoh()) + if (plugin.IsInDeepDungeon()) { ImGui.Text($"You are in a deep dungeon, territory type {plugin.LastTerritory}."); ImGui.Text($"Sync State = {plugin.TerritorySyncState}");