From f711316adc4ee7b13bb46e5fbb363a214dc0d223 Mon Sep 17 00:00:00 2001 From: Lee Date: Thu, 25 May 2017 09:09:02 +0100 Subject: [PATCH] Core/Map: fix NPCs falling through the textures (#482) this should stop creatures falling through the map (ie. if a cave is under the mountin) --- src/game/Maps/Map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 77be25259..5fa7b8d75 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -1813,7 +1813,7 @@ float Map::GetHeight(float x, float y, float z, bool checkVMap /*= true*/, float // we are already under the surface or vmap height above map heigt // or if the distance of the vmap height is less the land height distance - if (z < mapHeight || vmapHeight > mapHeight || fabs(mapHeight-z) > fabs(vmapHeight-z)) + if (vmapHeight > mapHeight || std::fabs(mapHeight - z) > std::fabs(vmapHeight - z)) return vmapHeight; else return mapHeight; // better use .map surface height