From 6b8a3dba7029366bcc950116d31227de96c7b81e Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 28 Nov 2010 20:53:57 +0000 Subject: TOON: Attempt to fix crash when Bricabrac puts on his glasses This was a regression in r54223, and it's the most direct fix I can think of. The problem seems to be that sys_Cmd_Remove_Scene_Anim() clears the character's _animationInstance while character::playAnim() is waiting "for the character to be ready". My fix was to treat _animationInstance NULL as another sign that the wait is over, but maybe the real fix is for sys_Cmd_Remove_Scene_Anim() to do more than just clear the variable, e.g. stop the script or something like that? svn-id: r54549 --- engines/toon/character.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index 1a63136c61..5cfa421af4 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -1030,7 +1030,7 @@ void Character::playAnim(int32 animId, int32 unused, int32 flags) { _flags |= 1; // wait for the character to be ready - while (_animScriptId != -1 && _animationInstance->getFrame() > 0 && (_specialAnim && _animationInstance->getAnimation() != _specialAnim)) { + while (_animScriptId != -1 && _animationInstance && _animationInstance->getFrame() > 0 && (_specialAnim && _animationInstance->getAnimation() != _specialAnim)) { _vm->simpleUpdate(false); } } -- cgit v1.2.3