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
This commit is contained in:
Denis Kasak 2009-07-25 03:41:28 +00:00
parent ed59a12d53
commit ceb9f18132

View File

@ -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);