residualvm/residualvm — pull request #793 by chkr-private (2013-12-19 23:53:02+00:00)
Title: EMI: fix pause handling (even more)

On vista point it may happen that two sequences for the rock landings
are executed at the same time. Although they intend to be locked via
pause_scripts(), changing the set will call unpause_scripts() and unlock
all of them. The result are a corrupted lua stack with lots of error messages like:

WARNING: Lua: call expression not a function!
WARNING: Bad argument to start_script, ignoring!
WARNING: Lua: call expression not a function!

and that Guybrush can't be moved or controlled any more.

The patch will use the optional boolean parameter for (un)pause_scripts() to
determine whether the pause calls should be "counting" (e.g. when
switching a set or opening the inventory) or not.

Notes:
- GRIM should not be affected, according to #784 only (un)pause_scripts() calls are used and they are always symmetrical
- in order to not break the Lua bar again, it seems to be necessary that single pause_scripts must not be "counting", because in the Lua bar they are called asymmetrically
- but since "global" pause_scripts() calls should still be effective the flags for local and global pause must still be maintained independently