diff options
author | Torbjörn Andersson | 2010-11-28 20:53:57 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2010-11-28 20:53:57 +0000 |
commit | 6b8a3dba7029366bcc950116d31227de96c7b81e (patch) | |
tree | a83b51ed58a7a22e5270b425a4e0915b840acdd4 /engines/toon | |
parent | ae1607cd99b89cb0da683ad44308abc759fd5c65 (diff) | |
download | scummvm-rg350-6b8a3dba7029366bcc950116d31227de96c7b81e.tar.gz scummvm-rg350-6b8a3dba7029366bcc950116d31227de96c7b81e.tar.bz2 scummvm-rg350-6b8a3dba7029366bcc950116d31227de96c7b81e.zip |
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
Diffstat (limited to 'engines/toon')
-rw-r--r-- | engines/toon/character.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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); } } |