diff options
author | Jeremy <Golrag@users.noreply.github.com> | 2018-02-16 20:59:19 +0100 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2018-02-16 20:59:19 +0100 |
commit | 9e0faace9a5114fc2324c2c601ba943272e0d6ff (patch) | |
tree | ee7cb56b687598c96d5e967d8f8857fc5cee8b07 /src/common/Collision/Maps/MapTree.cpp | |
parent | 8aa10f6c65ba7fc8363a663b305fede95d0ccb58 (diff) |
Core/Entities: Reduce the probability of units dropping under the map (#21322)
Reduce the probabilty of going under the map
Diffstat (limited to 'src/common/Collision/Maps/MapTree.cpp')
-rw-r--r-- | src/common/Collision/Maps/MapTree.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common/Collision/Maps/MapTree.cpp b/src/common/Collision/Maps/MapTree.cpp index 3a927acc310..c96adb6c87c 100644 --- a/src/common/Collision/Maps/MapTree.cpp +++ b/src/common/Collision/Maps/MapTree.cpp @@ -236,6 +236,19 @@ namespace VMAP return(height); } + float StaticMapTree::getCeil(const G3D::Vector3 & pPos, float maxSearchDist) const + { + float height = G3D::finf(); + Vector3 dir = Vector3(0, 0, 1); + G3D::Ray ray(pPos, dir); // direction with length of 1 + float maxDist = maxSearchDist; + if (getIntersectionTime(ray, maxDist, false, ModelIgnoreFlags::Nothing)) + { + height = pPos.z + maxDist; + } + return(height); + } + //========================================================= LoadResult StaticMapTree::CanLoadMap(const std::string &vmapPath, uint32 mapID, uint32 tileX, uint32 tileY) { |