aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2015-12-21 01:49:41 +0100
committerWillem Jan Palenstijn2015-12-23 21:35:33 +0100
commitbe1fd471be362eff1d6e05bef8b8469655174b16 (patch)
treeba76fd24b9a26bc362abbb9b6f6dd95dcfcf55c1
parent9b6851c1a73b57c262148a2d96ca7c07e32f96a5 (diff)
downloadscummvm-rg350-be1fd471be362eff1d6e05bef8b8469655174b16.tar.gz
scummvm-rg350-be1fd471be362eff1d6e05bef8b8469655174b16.tar.bz2
scummvm-rg350-be1fd471be362eff1d6e05bef8b8469655174b16.zip
LAB: better fix of loadMapData, taking into account the other loops on _maps
-rw-r--r--engines/lab/map.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index 63e3571b8f..db0ba206fe 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -87,8 +87,8 @@ void LabEngine::loadMapData() {
_music->stopSoundEffect();
_maxRooms = mapFile->readUint16LE();
- _maps = new MapData[_maxRooms]; // will be freed when the user exits the map
- for (int i = 0; i < _maxRooms; i++) {
+ _maps = new MapData[_maxRooms + 1]; // will be freed when the user exits the map
+ for (int i = 1; i <= _maxRooms; i++) {
_maps[i]._x = mapFile->readUint16LE();
_maps[i]._y = mapFile->readUint16LE();
_maps[i]._pageNumber = mapFile->readUint16LE();