From c57cc5c41f5ac68574daf33bd4152c17420bb237 Mon Sep 17 00:00:00 2001 From: Sabine Lim Date: Wed, 17 Jul 2024 05:00:08 +1000 Subject: [PATCH] Fix incorrect GetMapCoordinates() within housing ward subdivisions (#1917) Co-authored-by: Sabine Lim --- Dalamud/Utility/MapUtil.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dalamud/Utility/MapUtil.cs b/Dalamud/Utility/MapUtil.cs index 4eed22623..221f9cb55 100644 --- a/Dalamud/Utility/MapUtil.cs +++ b/Dalamud/Utility/MapUtil.cs @@ -155,8 +155,12 @@ public static class MapUtil return WorldToMap( go.Position, - agentMap->CurrentOffsetX, - agentMap->CurrentOffsetY, + /* + * https://github.com/aers/FFXIVClientStructs/issues/1029 + * Our calculations are based on Excel's Map, but AgentMap's offset values are sign-flipped in comparison + */ + -agentMap->CurrentOffsetX, + -agentMap->CurrentOffsetY, territoryTransient?.OffsetZ ?? 0, (uint)agentMap->CurrentMapSizeFactor, correctZOffset);