aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/map.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2017-11-16 20:59:07 -0500
committerPaul Gilbert2017-11-16 20:59:07 -0500
commit6421170f9224cf56eda4a6502014d315bb3eec70 (patch)
tree69b978e75d9267fe32fcaf552b177a86438e886e /engines/xeen/map.cpp
parent2b823d63d42973e751db5f5ff8a4efed10faa239 (diff)
downloadscummvm-rg350-6421170f9224cf56eda4a6502014d315bb3eec70.tar.gz
scummvm-rg350-6421170f9224cf56eda4a6502014d315bb3eec70.tar.bz2
scummvm-rg350-6421170f9224cf56eda4a6502014d315bb3eec70.zip
XEEN: Map and game flag fixes
Diffstat (limited to 'engines/xeen/map.cpp')
-rw-r--r--engines/xeen/map.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index a459b56ae4..b9b674cbdd 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -987,7 +987,7 @@ void Map::load(int mapId) {
if (isDarkCc && mapId == 50)
mazeDataP->setAllTilesStepped();
- if (!isDarkCc && _vm->_party->_gameFlags[25] &&
+ if (!isDarkCc && _vm->_party->_gameFlags[0][25] &&
(mapId == 42 || mapId == 43 || mapId == 4)) {
mazeDataP->clearCellSurfaces();
}
@@ -1061,7 +1061,7 @@ void Map::load(int mapId) {
_mobData._objects[29]._spriteId = 0;
_mobData._objects[29]._id = 8;
_mobData._objectSprites[i]._sprites.clear();
- } else if (mapId == 12 && _vm->_party->_gameFlags[43] &&
+ } else if (mapId == 12 && _vm->_party->_gameFlags[0][43] &&
_mobData._objectSprites[i]._spriteId == 118 && !isDarkCc) {
filename = "085.obj";
_mobData._objectSprites[0]._spriteId = 85;
@@ -1451,11 +1451,11 @@ int Map::getCell(int idx) {
_currentWall = INVALID_CELL;
return INVALID_CELL;
}
-
- _mazeDataIndex = 0;
- while (_mazeData[_mazeDataIndex]._mazeId != mapId)
- ++_mazeDataIndex;
}
+
+ _mazeDataIndex = 0;
+ while (_mazeData[_mazeDataIndex]._mazeId != mapId)
+ ++_mazeDataIndex;
}
if (pt.x & 16) {
@@ -1494,10 +1494,10 @@ int Map::getCell(int idx) {
++_mazeDataIndex;
}
+ assert(ABS(pt.x) < 16 && ABS(pt.y) < 16);
int wallData = _mazeData[_mazeDataIndex]._wallData[pt.y][pt.x]._data;
if (_isOutdoors) {
if (mapId) {
- // TODO: tile is set to word of (wallLayers >> 8) && 0xff? Makes no sense
_currentTile = (wallData >> 8) & 0xFF;
_currentWall = (wallData >> 4) & 0xF;
_currentSurfaceId = wallData & 0xF;
@@ -1510,11 +1510,7 @@ int Map::getCell(int idx) {
if (!mapId)
return 0;
- if (pt.x > 31 || pt.y > 31)
- _currentSurfaceId = 7;
- else
- _currentSurfaceId = _mazeData[_mazeDataIndex]._cells[pt.y][pt.x]._surfaceId;
-
+ _currentSurfaceId = _mazeData[_mazeDataIndex]._cells[pt.y][pt.x]._surfaceId;
_currentWall = wallData;
return (_currentWall >> Res.WALL_SHIFTS[dir][idx]) & 0xF;
}