aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
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
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')
-rw-r--r--engines/tsage/core.cpp12
-rw-r--r--engines/tsage/core.h5
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) {