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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user