diff options
Diffstat (limited to 'engines/mads/rails.cpp')
-rw-r--r-- | engines/mads/rails.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/engines/mads/rails.cpp b/engines/mads/rails.cpp index 9b2ec71de6..46d9e0ebd3 100644 --- a/engines/mads/rails.cpp +++ b/engines/mads/rails.cpp @@ -149,7 +149,7 @@ int Rails::scanPath(const Common::Point &srcPos, const Common::Point &destPos) { ++xDiff; ++yDiff; - const byte *srcP = _depthSurface->getBasePtr(srcPos.x, srcPos.y); + const byte *srcP = (const byte *)_depthSurface->getBasePtr(srcPos.x, srcPos.y); int index = xAmount; // Outer loop @@ -274,4 +274,18 @@ void Rails::synchronize(Common::Serializer &s) { } } +void Rails::disableNode(int nodeIndex) { + _nodes[nodeIndex]._active = false; + + for (uint16 i = 0; i < _nodes.size(); i++) { + if (i != nodeIndex) + disableLine(i, nodeIndex); + } +} + +void Rails::disableLine(int from, int to) { + _nodes[from]._distances[to] = 0x3FFF; + _nodes[to]._distances[from] = 0x3FFF; +} + } // End of namespace MADS |