diff options
author | Filippos Karapetis | 2015-12-04 22:52:55 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:51 +0100 |
commit | 6f3644f377cb298cb82d7a9235b9aec4cfa875ea (patch) | |
tree | 5c12b0771eda96f3235203334d57390f41fa540b | |
parent | dddd07cc8754117811c296d9b0c384306e70baa0 (diff) | |
download | scummvm-rg350-6f3644f377cb298cb82d7a9235b9aec4cfa875ea.tar.gz scummvm-rg350-6f3644f377cb298cb82d7a9235b9aec4cfa875ea.tar.bz2 scummvm-rg350-6f3644f377cb298cb82d7a9235b9aec4cfa875ea.zip |
LAB: Fix a regression in roomCoords()
-rw-r--r-- | engines/lab/map.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index 36591d759b..4df01eae36 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -253,12 +253,20 @@ static void roomCoords(uint16 CurRoom, uint16 *x1, uint16 *y1, uint16 *x2, uint1 case HCORRIDOR: curRoomImg = HRoom; break; + default: + // Some rooms (like the map) do not have an image + break; } *x1 = mapScaleX(Maps[CurRoom].x); *y1 = mapScaleY(Maps[CurRoom].y); - *x2 = *x1 + curRoomImg->_width; - *y2 = *y1 + curRoomImg->_height; + *x2 = *x1; + *y2 = *y1; + + if (curRoomImg) { + *x2 += curRoomImg->_width; + *y2 += curRoomImg->_height; + } } /*****************************************************************************/ |