diff options
author | Strangerke | 2013-10-31 08:25:19 +0100 |
---|---|---|
committer | Strangerke | 2013-10-31 08:25:19 +0100 |
commit | 40c6569940e26fb6c020c54947e45614bfa0d7e9 (patch) | |
tree | eb894ead28a27cda9ebcb6b4cec0b67dde9dfed3 /engines | |
parent | ba50475dfaa812f34da87c76e95672a8e6cc8702 (diff) | |
download | scummvm-rg350-40c6569940e26fb6c020c54947e45614bfa0d7e9.tar.gz scummvm-rg350-40c6569940e26fb6c020c54947e45614bfa0d7e9.tar.bz2 scummvm-rg350-40c6569940e26fb6c020c54947e45614bfa0d7e9.zip |
HUGO: Fix CID 1003560, 1002882
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hugo/parser.cpp | 4 | ||||
-rw-r--r-- | engines/hugo/route.cpp | 11 | ||||
-rw-r--r-- | engines/hugo/route.h | 4 |
3 files changed, 16 insertions, 3 deletions
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index 2585c64fd8..cb55e1fd68 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 54dae88c28..8355e1dd10 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 716829a201..71db1e2583 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(); |