aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorDenis Kasak2009-07-25 03:41:28 +0000
committerDenis Kasak2009-07-25 03:41:28 +0000
commitceb9f18132cb32df7d76a03d0371f41a29c5d120 (patch)
tree9f9337d4f6fdef345d7405b80840f275a2a75ff1 /engines/draci
parented59a12d53e9dc26c53620333b6a94a11980f3a8 (diff)
downloadscummvm-rg350-ceb9f18132cb32df7d76a03d0371f41a29c5d120.tar.gz
scummvm-rg350-ceb9f18132cb32df7d76a03d0371f41a29c5d120.tar.bz2
scummvm-rg350-ceb9f18132cb32df7d76a03d0371f41a29c5d120.zip
Made Script::run() manually mark the last animation index before it executes a program. This is done to prevent Release wreaking havoc if it is unpaired (i.e. if the script forgot to call a Mark first).
svn-id: r42733
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/script.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index a7bb8bda09..1d2f4a8892 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -565,6 +565,10 @@ const GPL2Command *Script::findCommand(byte num, byte subnum) {
int Script::run(GPL2Program program, uint16 offset) {
+ // Mark the last animation index before we do anything so a Release command
+ // doesn't unload too many animations if we forget to use a Mark command first
+ _vm->_game->setMarkedAnimationIndex(_vm->_anims->getLastIndex());
+
// Stream reader for the whole program
Common::MemoryReadStream reader(program._bytecode, program._length);