diff options
Diffstat (limited to 'src/game/Map.cpp')
-rw-r--r-- | src/game/Map.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 6c693bfe177..6e12597f4dd 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -1137,6 +1137,10 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const int lx_int = (int)lx; int ly_int = (int)ly; + // In some very rare case this will happen. Need find a better way. + if(lx_int == MAP_RESOLUTION) --lx_int; + if(ly_int == MAP_RESOLUTION) --ly_int; + float zi[4]; // Probe 4 nearest points (except border cases) zi[0] = gmap->Z[lx_int][ly_int]; |