summaryrefslogtreecommitdiff
path: root/src/resources/map/mapheights.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-14 18:10:31 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-14 18:10:31 +0300
commitb0ccb9a396be7d73771f4dbe499d851f0e7bf630 (patch)
treeb7ffa555565c23bd9abf93c15d10437a5f0cd5b2 /src/resources/map/mapheights.h
parent509f043983f347a33c65b0f7beee91236e622bf9 (diff)
downloadmv-b0ccb9a396be7d73771f4dbe499d851f0e7bf630.tar.gz
mv-b0ccb9a396be7d73771f4dbe499d851f0e7bf630.tar.bz2
mv-b0ccb9a396be7d73771f4dbe499d851f0e7bf630.tar.xz
mv-b0ccb9a396be7d73771f4dbe499d851f0e7bf630.zip
Fix crash if warp to smaller map into tile with height > 0.
Diffstat (limited to 'src/resources/map/mapheights.h')
-rw-r--r--src/resources/map/mapheights.h2
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;