aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/rails.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads/rails.cpp')
-rw-r--r--engines/mads/rails.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/engines/mads/rails.cpp b/engines/mads/rails.cpp
index 322e6e7cb3..46d9e0ebd3 100644
--- a/engines/mads/rails.cpp
+++ b/engines/mads/rails.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -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