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

This commit is contained in:
Treeston
2018-02-26 18:11:29 +01:00
parent e79c595b69
commit ec916db294

View File

@@ -2682,7 +2682,11 @@ void Map::GetFullTerrainStatusForPosition(float x, float y, float z, PositionFul
// 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 = GetWMOAreaTableEntryByTripple(vmapData.areaInfo->rootId, vmapData.areaInfo->adtId, vmapData.areaInfo->groupId)))
areaEntry = sAreaTableStore.LookupEntry(wmoEntry->areaId);