Ensure new deep dungeon data in 6.35 is only processed when enabled on both server & client

This commit is contained in:
Liza 2022-11-30 11:37:34 +01:00
parent 350da5e916
commit d0eb5f0e69
2 changed files with 8 additions and 4 deletions

View File

@ -13,6 +13,7 @@ using Grpc.Core;
using ImGuiNET; using ImGuiNET;
using Lumina.Excel.GeneratedSheets; using Lumina.Excel.GeneratedSheets;
using Pal.Client.Windows; using Pal.Client.Windows;
using Pal.Common;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
@ -243,7 +244,7 @@ namespace Pal.Client
LastTerritory = Service.ClientState.TerritoryType; LastTerritory = Service.ClientState.TerritoryType;
TerritorySyncState = SyncState.NotAttempted; TerritorySyncState = SyncState.NotAttempted;
if (IsInPotdOrHoh()) if (IsInDeepDungeon())
FloorMarkers[LastTerritory] = LocalState.Load(LastTerritory) ?? new LocalState(LastTerritory); FloorMarkers[LastTerritory] = LocalState.Load(LastTerritory) ?? new LocalState(LastTerritory);
EphemeralMarkers.Clear(); EphemeralMarkers.Clear();
PomanderOfSight = PomanderState.Inactive; PomanderOfSight = PomanderState.Inactive;
@ -252,7 +253,7 @@ namespace Pal.Client
DebugMessage = null; DebugMessage = null;
} }
if (!IsInPotdOrHoh()) if (!IsInDeepDungeon())
return; return;
if (Service.Configuration.Mode == Configuration.EMode.Online && TerritorySyncState == SyncState.NotAttempted) if (Service.Configuration.Mode == Configuration.EMode.Online && TerritorySyncState == SyncState.NotAttempted)
@ -650,7 +651,10 @@ namespace Pal.Client
return result; 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) internal static Element CreateSplatoonElement(Marker.EType type, Vector3 pos, Vector4 color, bool fill = false)
=> CreateSplatoonElement(type, pos, ImGui.ColorConvertFloat4ToU32(color), fill); => CreateSplatoonElement(type, pos, ImGui.ColorConvertFloat4ToU32(color), fill);

View File

@ -152,7 +152,7 @@ namespace Pal.Client.Windows
if (ImGui.BeginTabItem("Debug")) if (ImGui.BeginTabItem("Debug"))
{ {
var plugin = Service.Plugin; var plugin = Service.Plugin;
if (plugin.IsInPotdOrHoh()) if (plugin.IsInDeepDungeon())
{ {
ImGui.Text($"You are in a deep dungeon, territory type {plugin.LastTerritory}."); ImGui.Text($"You are in a deep dungeon, territory type {plugin.LastTerritory}.");
ImGui.Text($"Sync State = {plugin.TerritorySyncState}"); ImGui.Text($"Sync State = {plugin.TerritorySyncState}");