aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/core.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2011-02-15 21:55:38 +1100
committerPaul Gilbert2011-02-15 21:55:38 +1100
commit96df5dfa82e6d281cbf84da1606a4639ff0a6f1f (patch)
tree9e480671117e2dc8e1d1f04be444ede1f33959b5 /engines/tsage/core.cpp
parentc45d141dae4b022fa7e3cc3a9b6b4b1d90117fe0 (diff)
downloadscummvm-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/core.cpp')
-rw-r--r--engines/tsage/core.cpp12
1 files changed, 10 insertions, 2 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();