diff options
author | megamage <none@none> | 2009-01-16 19:05:30 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-16 19:05:30 -0600 |
commit | ba4338783abb39dcee772511a61d671e6c0256ab (patch) | |
tree | bf9c3c9a9c4f73803241d1092e8e1a8c408e90bb /src/game/Map.cpp | |
parent | 6a66df09ebb158de53c947b1f4aa827ba2a942d0 (diff) |
*Fix Creature::FallGround. By Silver1ce.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Map.cpp')
-rw-r--r-- | src/game/Map.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 3958f0ea8bf..d9971518bf3 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -1265,6 +1265,26 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const } } +float Map::GetVmapHeight(float x, float y, float z, bool useMaps) const +{ + float mapHeight; + float vmapHeight; + if (useMaps) + { + mapHeight = GetHeight(x, y, z, false); + if (fabs(mapHeight - z) < 0.1) + return mapHeight; + } + else + mapHeight = INVALID_HEIGHT; + VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager(); + if (vmgr->isLineOfSightCalcEnabled()) + bool result = vmgr->getObjectHitPos(GetId(), x, y, z + 2.0f, x, y, mapHeight, x, y, vmapHeight, 0); + else + return INVALID_HEIGHT; + return vmapHeight; +} + uint16 Map::GetAreaFlag(float x, float y ) const { //local x,y coords |