LAB: better fix of loadMapData, taking into account the other loops on _maps

This commit is contained in:
Strangerke 2015-12-21 01:49:41 +01:00 committed by Willem Jan Palenstijn
parent 9b6851c1a7
commit be1fd471be

View File

@ -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();