From ceb9f18132cb32df7d76a03d0371f41a29c5d120 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Sat, 25 Jul 2009 03:41:28 +0000 Subject: 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 --- engines/draci/script.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/draci') 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); -- cgit v1.2.3