diff options
author | Paul Gilbert | 2015-02-27 20:52:59 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-27 20:52:59 -0500 |
commit | b9539c6cb168ecabda994353a453e050b380487f (patch) | |
tree | b8a8a1dc61f0baf64d740bde2d125fffaa52704a /engines/xeen/map.cpp | |
parent | b46561ef293da3299ff4e7fb85ffd49222faab67 (diff) | |
download | scummvm-rg350-b9539c6cb168ecabda994353a453e050b380487f.tar.gz scummvm-rg350-b9539c6cb168ecabda994353a453e050b380487f.tar.bz2 scummvm-rg350-b9539c6cb168ecabda994353a453e050b380487f.zip |
XEEN: Fixes for marking grates as unlocked
Diffstat (limited to 'engines/xeen/map.cpp')
-rw-r--r-- | engines/xeen/map.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index 2017978398..e5a5531cbf 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -891,7 +891,7 @@ Map::Map(XeenEngine *vm) : _vm(vm), _mobData(vm) { _currentSurfaceId = 0; _currentWall = 0; _currentTile = 0; - _currentIsGrate = false; + _currentGrateUnlocked = false; _currentCantRest = false; _currentIsDrain = false; _currentIsEvent = false; @@ -1383,7 +1383,7 @@ void Map::cellFlagLookup(const Common::Point &pt) { // Get the cell flags const MazeCell &cell = _mazeData[_mazeDataIndex]._cells[pos.y][pos.x]; - _currentIsGrate = cell._flags & OUTFLAG_GRATE; + _currentGrateUnlocked = cell._flags & OUTFLAG_GRATE; _currentCantRest = cell._flags & RESTRICTION_REST; _currentIsDrain = cell._flags & OUTFLAG_DRAIN; _currentIsEvent = cell._flags & FLAG_AUTOEXECUTE_EVENT; @@ -1393,14 +1393,17 @@ void Map::cellFlagLookup(const Common::Point &pt) { void Map::setCellSurfaceFlags(const Common::Point &pt, int bits) { mazeLookup(pt, 0); - _mazeData[0]._cells[pt.y][pt.x]._surfaceId |= bits; + + Common::Point mapPos(pt.x & 15, pt.y & 15); + _mazeData[_mazeDataIndex]._cells[mapPos.y][mapPos.x]._surfaceId |= bits; } void Map::setWall(const Common::Point &pt, Direction dir, int v) { const int XOR_MASKS[4] = { 0xFFF, 0xF0FF, 0xFF0F, 0xFFF0 }; mazeLookup(pt, 0, 0); - MazeWallLayers &wallLayer = _mazeData[0]._wallData[pt.y][pt.x]; + Common::Point mapPos(pt.x & 15, pt.y & 15); + MazeWallLayers &wallLayer = _mazeData[_mazeDataIndex]._wallData[mapPos.y][mapPos.x]; wallLayer._data &= XOR_MASKS[dir]; wallLayer._data |= v << WALL_SHIFTS[dir][2]; } |