diff options
Diffstat (limited to 'engines/toon/character.cpp')
-rw-r--r-- | engines/toon/character.cpp | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index 83c9e3ec70..51e8dee19f 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -1,24 +1,24 @@ /* ScummVM - Graphic Adventure Engine -* -* ScummVM is the legal property of its developers, whose names -* are too numerous to list here. Please refer to the COPYRIGHT -* file distributed with this source distribution. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. - -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. - -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -*/ + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ #include "common/debug.h" #include "common/system.h" @@ -65,6 +65,7 @@ Character::Character(ToonEngine *vm) : _vm(vm) { _numPixelToWalk = 0; _nextIdleTime = _vm->_system->getMillis() + (_vm->randRange(0, 600) + 300) * _vm->getTickLength(); _lineToSayId = 0; + _time = 0; } Character::~Character(void) { @@ -1058,12 +1059,14 @@ void Character::playAnim(int32 animId, int32 unused, int32 flags) { _specialAnim->loadAnimation(animName); _animSpecialId = animId; - - _animationInstance->setAnimation(_specialAnim); - _animationInstance->setAnimationRange(0, _specialAnim->_numFrames - 1); - _animationInstance->reset(); - _animationInstance->stopAnimation(); - _animationInstance->setLooping(false); + + if (_animationInstance) { + _animationInstance->setAnimation(_specialAnim); + _animationInstance->setAnimationRange(0, _specialAnim->_numFrames - 1); + _animationInstance->reset(); + _animationInstance->stopAnimation(); + _animationInstance->setLooping(false); + } } int32 Character::getAnimFlag() { |