diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-14 18:10:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-14 18:10:31 +0300 |
commit | b0ccb9a396be7d73771f4dbe499d851f0e7bf630 (patch) | |
tree | b7ffa555565c23bd9abf93c15d10437a5f0cd5b2 | |
parent | 509f043983f347a33c65b0f7beee91236e622bf9 (diff) | |
download | manaverse-b0ccb9a396be7d73771f4dbe499d851f0e7bf630.tar.gz manaverse-b0ccb9a396be7d73771f4dbe499d851f0e7bf630.tar.bz2 manaverse-b0ccb9a396be7d73771f4dbe499d851f0e7bf630.tar.xz manaverse-b0ccb9a396be7d73771f4dbe499d851f0e7bf630.zip |
Fix crash if warp to smaller map into tile with height > 0.
-rw-r--r-- | src/resources/map/mapheights.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resources/map/mapheights.h b/src/resources/map/mapheights.h index c0fb2b6f8..149645b3d 100644 --- a/src/resources/map/mapheights.h +++ b/src/resources/map/mapheights.h @@ -37,7 +37,7 @@ class MapHeights final void setHeight(const int x, const int y, const uint8_t height); uint8_t getHeight(const int x, const int y) const - { return mTiles[x + y * mWidth]; } + { return x < mWidth && y < mHeight ? mTiles[x + y * mWidth] : 0; } private: int mWidth; |