aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/route.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hugo/route.cpp')
-rw-r--r--engines/hugo/route.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp
index 54dae88c28..dc3c41de9c 100644
--- a/engines/hugo/route.cpp
+++ b/engines/hugo/route.cpp
@@ -45,6 +45,17 @@ Route::Route(HugoEngine *vm) : _vm(vm) {
_routeIndex = -1; // Hero not following a route
_routeType = kRouteSpace; // Hero walking to space
_routeObjId = -1; // Hero not walking to anything
+
+ for (int i = 0; i < kMaxSeg; i++)
+ _segment[i]._y = _segment[i]._x1 = _segment[i]._x2 = 0;
+
+ _segmentNumb = 0;
+ _routeListIndex = 0;
+ _destX = _destY = 0;
+ _heroWidth = 0;
+ _routeFoundFl = false;
+ _fullStackFl = false;
+ _fullSegmentFl = false;
}
void Route::resetRoute() {
@@ -303,7 +314,7 @@ Common::Point *Route::newNode() {
_routeListIndex++;
if (_routeListIndex >= kMaxNodes) // Too many nodes
- return 0; // Incomplete route - failure
+ return nullptr; // Incomplete route - failure
_route[_routeListIndex] = _route[_routeListIndex - 1]; // Initialize with previous node
return &_route[_routeListIndex];