Core/VMap: Use fuzzy equality and gridmap tolerance for floor-finding. Closes #21338. Supersedes #21479.

(cherry picked from commit ec916db294760576ef4466d7e558f038dacecf20)
This commit is contained in:
Treeston
2021-08-08 21:21:34 +02:00
committed by funjoker
parent e47e95b6dc
commit 552ce7c286
+5 -1
View File
@@ -2804,7 +2804,11 @@ void Map::GetFullTerrainStatusForPosition(PhaseShift const& phaseShift, float x,
// area lookup
AreaTableEntry const* areaEntry = nullptr;
WMOAreaTableEntry const* wmoEntry = nullptr;
if (vmapData.areaInfo && (z <= mapHeight || mapHeight <= vmapData.floorZ))
// the vmap floor is our floor if either
// - the vmap floor is above the gridmap floor
// or
// - we are below the gridmap floor
if (vmapData.areaInfo && (G3D::fuzzyLt(z, mapHeight - GROUND_HEIGHT_TOLERANCE) || mapHeight <= vmapData.floorZ))
if ((wmoEntry = sDB2Manager.GetWMOAreaTable(vmapData.areaInfo->rootId, vmapData.areaInfo->adtId, vmapData.areaInfo->groupId)))
areaEntry = sAreaTableStore.LookupEntry(wmoEntry->AreaTableID);