[Scummvm-cvs-logs] scummvm master -> 40c6569940e26fb6c020c54947e45614bfa0d7e9

Strangerke Strangerke at scummvm.org
Thu Oct 31 08:25:49 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
40c6569940 HUGO: Fix CID 1003560, 1002882


Commit: 40c6569940e26fb6c020c54947e45614bfa0d7e9
    https://github.com/scummvm/scummvm/commit/40c6569940e26fb6c020c54947e45614bfa0d7e9
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-31T00:25:19-07:00

Commit Message:
HUGO: Fix CID 1003560, 1002882

Changed paths:
    engines/hugo/parser.cpp
    engines/hugo/route.cpp
    engines/hugo/route.h



diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index 2585c64..cb55e1f 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -398,9 +398,9 @@ void Parser::command(const char *format, ...) {
  * Locate any member of object name list appearing in command line
  */
 bool Parser::isWordPresent(char **wordArr) const {
-	debugC(1, kDebugParser, "isWordPresent(%s)", wordArr[0]);
-
 	if (wordArr != 0) {
+		debugC(1, kDebugParser, "isWordPresent(%s)", wordArr[0]);
+
 		for (int i = 0; strlen(wordArr[i]); i++) {
 			if (strstr(_vm->_line, wordArr[i]))
 				return true;
diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp
index 54dae88..8355e1d 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() {
diff --git a/engines/hugo/route.h b/engines/hugo/route.h
index 716829a..71db1e2 100644
--- a/engines/hugo/route.h
+++ b/engines/hugo/route.h
@@ -79,9 +79,11 @@ private:
 	int16 _destY;
 	int16 _heroWidth;                               // Hero width
 	bool  _routeFoundFl;                            // TRUE when path found
-	bool  _fullStackFl;                             // TRUE if stack exhausted
 	bool  _fullSegmentFl;                           // Segments exhausted
 
+	// CHECKME: Never set to true, could be removed
+	bool  _fullStackFl;                             // TRUE if stack exhausted
+
 	void segment(int16 x, int16 y);
 	bool findRoute(const int16 cx, const int16 cy);
 	Common::Point *newNode();






More information about the Scummvm-git-logs mailing list