From 0d6d895478dee36170c4c1d909c5f9b3354ec68b Mon Sep 17 00:00:00 2001 From: Sylvain Dupont Date: Sun, 10 Oct 2010 14:30:13 +0000 Subject: TOON: Disable too many levels of recursion with click events svn-id: r53119 --- engines/toon/toon.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/toon') diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index f1a31323c7..4843d39add 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -1121,7 +1121,8 @@ int32 ToonEngine::randRange(int32 minStart, int32 maxStart) { int32 ToonEngine::runEventScript(int32 x, int32 y, int32 mode, int32 id, int32 scriptId) { - assert(_currentScriptRegion < 4); + if (_currentScriptRegion >= 4) + return 0; EMCState *status = &_scriptState[_currentScriptRegion]; _script->init(status, &_scriptData); @@ -1228,6 +1229,7 @@ void ToonEngine::clickEvent() { commandId = 2 * (_gameState->_mouseState - 1) + 16; } + _drew->stopWalk(); int16 command = currentHot->getData(commandId); int16 argument = currentHot->getData(commandId + 1); -- cgit v1.2.3