aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-09-10 14:43:42 +0000
committerMax Horn2003-09-10 14:43:42 +0000
commit1ccc58aa035d3d74efe1dc66f7327b432727a8f1 (patch)
treefeb846c69e17db0f60ff6a860172bcf18463bf38
parent080128d7485b251736c87fa2df9cb9d0a4a2d90b (diff)
downloadscummvm-rg350-1ccc58aa035d3d74efe1dc66f7327b432727a8f1.tar.gz
scummvm-rg350-1ccc58aa035d3d74efe1dc66f7327b432727a8f1.tar.bz2
scummvm-rg350-1ccc58aa035d3d74efe1dc66f7327b432727a8f1.zip
cleanup
svn-id: r10158
-rw-r--r--scumm/script.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index b1b7e8cbd5..37f6bb8e0c 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -217,20 +217,19 @@ void Scumm::stopScript(int script) {
}
}
- if (_numNestedScripts == 0)
- return;
-
nest = vm.nest;
num = _numNestedScripts;
- do {
+ while (num > 0) {
if (nest->number == script &&
(nest->where == WIO_GLOBAL || nest->where == WIO_LOCAL)) {
nest->number = 0xFF;
nest->slot = 0xFF;
nest->where = 0xFF;
}
- } while (nest++, --num);
+ nest++;
+ num--;
+ }
}
/* Stop an object script 'script'*/
@@ -255,20 +254,19 @@ void Scumm::stopObjectScript(int script) {
}
}
- if (_numNestedScripts == 0)
- return;
-
nest = vm.nest;
num = _numNestedScripts;
- do {
+ while (num > 0) {
if (nest->number == script &&
(nest->where == WIO_ROOM || nest->where == WIO_INVENTORY || nest->where == WIO_FLOBJECT)) {
nest->number = 0xFF;
nest->slot = 0xFF;
nest->where = 0xFF;
}
- } while (nest++, --num);
+ nest++;
+ num--;
+ }
}
/* Return a free script slot */