diff options
-rw-r--r-- | engines/tsage/core.cpp | 12 | ||||
-rw-r--r-- | engines/tsage/core.h | 5 |
2 files changed, 11 insertions, 6 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 6d27293721..fcf1afc6eb 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -880,8 +880,9 @@ int PlayerMover::proc1(int *routeList, int srcRegion, int destRegion, int &v) { } else { int foundIndex = 0; int idx = 0; - while (_globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + idx]) { - if (_globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + idx] == destRegion) { + int currDest; + while ((currDest = _globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + idx]) != 0) { + if (currDest == destRegion) { foundIndex = idx; break; } @@ -2950,6 +2951,13 @@ void WRField18::load(byte *data) { /*--------------------------------------------------------------------------*/ +void WalkRegions::clear() { + _regionList.clear(); + _field18.clear(); + _idxList.clear(); + _idxList2.clear(); +} + void WalkRegions::load(int sceneNum) { clear(); diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 3ef7585b62..43b9349ccb 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -765,10 +765,7 @@ public: public: WalkRegions() { _resNum = -1; } - void clear() { - _regionList.clear(); - _field18.clear(); - } + void clear(); void load(int sceneNum); int indexOf(const Common::Point &pt, List<int> *indexList = NULL); WalkRegion &operator[](int idx) { |