diff options
author | Paul Gilbert | 2011-02-15 21:55:38 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-02-15 21:55:38 +1100 |
commit | 96df5dfa82e6d281cbf84da1606a4639ff0a6f1f (patch) | |
tree | 9e480671117e2dc8e1d1f04be444ede1f33959b5 /engines/tsage | |
parent | c45d141dae4b022fa7e3cc3a9b6b4b1d90117fe0 (diff) | |
download | scummvm-rg350-96df5dfa82e6d281cbf84da1606a4639ff0a6f1f.tar.gz scummvm-rg350-96df5dfa82e6d281cbf84da1606a4639ff0a6f1f.tar.bz2 scummvm-rg350-96df5dfa82e6d281cbf84da1606a4639ff0a6f1f.zip |
TSAGE: Bugfix to correctly clear the walk region intersection lists when changing scenes
Diffstat (limited to 'engines/tsage')
-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) { |