diff options
author | Max Horn | 2011-04-05 13:43:54 +0200 |
---|---|---|
committer | Max Horn | 2011-04-05 15:18:08 +0200 |
commit | 55e65cee8099d91ae4797f7772cb5e459089892a (patch) | |
tree | f04db2406cc7441027ee10d08c488cce62fd36de /engines/scumm/script.cpp | |
parent | a12dada82249cb713e2a9162b26ad3207127726c (diff) | |
download | scummvm-rg350-55e65cee8099d91ae4797f7772cb5e459089892a.tar.gz scummvm-rg350-55e65cee8099d91ae4797f7772cb5e459089892a.tar.bz2 scummvm-rg350-55e65cee8099d91ae4797f7772cb5e459089892a.zip |
SCUMM: Cleanup
Diffstat (limited to 'engines/scumm/script.cpp')
-rw-r--r-- | engines/scumm/script.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index c481fb8a4e..c6c1f5f58f 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -261,8 +261,7 @@ void ScummEngine::stopScript(int script) { /* Stop an object script 'script'*/ void ScummEngine::stopObjectScript(int script) { ScriptSlot *ss; - NestedScript *nest; - int i, num; + int i; if (script == 0) return; @@ -282,19 +281,14 @@ void ScummEngine::stopObjectScript(int script) { } } - nest = vm.nest; - num = vm.numNestedScripts; - - while (num > 0) { - if (nest->number == script && - (nest->where == WIO_ROOM || nest->where == WIO_INVENTORY || nest->where == WIO_FLOBJECT)) { - nukeArrays(nest->slot); - nest->number = 0xFF; - nest->slot = 0xFF; - nest->where = 0xFF; + for (i = 0; i < vm.numNestedScripts; ++i) { + if (vm.nest[i].number == script && + (vm.nest[i].where == WIO_ROOM || vm.nest[i].where == WIO_INVENTORY || vm.nest[i].where == WIO_FLOBJECT)) { + nukeArrays(vm.nest[i].slot); + vm.nest[i].number = 0xFF; + vm.nest[i].slot = 0xFF; + vm.nest[i].where = 0xFF; } - nest++; - num--; } } |