summaryrefslogtreecommitdiff
path: root/src/resources/map/mapheights.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-05-22 23:38:10 +0300
committerAndrei Karas <akaras@inbox.ru>2018-05-23 00:25:20 +0300
commit700032eb94fb6a67bef01606387ec5779e2714cf (patch)
tree4978ec6631f93d1a5ac4187e0dab3ccd5dad33b9 /src/resources/map/mapheights.h
parentf1dfe88c7a0c30de14439277c4ba7d69bd495fbf (diff)
downloadmanaverse-700032eb94fb6a67bef01606387ec5779e2714cf.tar.gz
manaverse-700032eb94fb6a67bef01606387ec5779e2714cf.tar.bz2
manaverse-700032eb94fb6a67bef01606387ec5779e2714cf.tar.xz
manaverse-700032eb94fb6a67bef01606387ec5779e2714cf.zip
Fix crash with wrong moving path.
Diffstat (limited to 'src/resources/map/mapheights.h')
-rw-r--r--src/resources/map/mapheights.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resources/map/mapheights.h b/src/resources/map/mapheights.h
index a4cd9f699..c3c832a4c 100644
--- a/src/resources/map/mapheights.h
+++ b/src/resources/map/mapheights.h
@@ -42,8 +42,8 @@ class MapHeights final : public MemoryCounter
uint8_t getHeight(const int x, const int y) const
{
- return x < mWidth &&
- y < mHeight ? mTiles[x + y * mWidth] : CAST_U8(0U);
+ return (x < mWidth &&
+ y < mHeight) ? mTiles[x + y * mWidth] : CAST_U8(0U);
}
int calcMemoryLocal() const override final;