From 700032eb94fb6a67bef01606387ec5779e2714cf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 22 May 2018 23:38:10 +0300 Subject: Fix crash with wrong moving path. --- src/resources/map/mapheights.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/resources/map') 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; -- cgit v1.2.3-70-g09d2