aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-11-20 22:25:01 -0500
committerPaul Gilbert2014-12-12 22:36:46 -0500
commit968bfec0677c75943fde080c63ab2e265aefa2b2 (patch)
treeaff3fbaee75ee79106c25dc44e561ec3a5e5845a
parent60ee5456c9b7436e0830ba30a30acb53051d2820 (diff)
downloadscummvm-rg350-968bfec0677c75943fde080c63ab2e265aefa2b2.tar.gz
scummvm-rg350-968bfec0677c75943fde080c63ab2e265aefa2b2.tar.bz2
scummvm-rg350-968bfec0677c75943fde080c63ab2e265aefa2b2.zip
ACCESS: Workaround for original setting animations when none is loaded
-rw-r--r--engines/access/animation.cpp4
-rw-r--r--engines/access/scripts.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/engines/access/animation.cpp b/engines/access/animation.cpp
index de44740c7f..184b015371 100644
--- a/engines/access/animation.cpp
+++ b/engines/access/animation.cpp
@@ -304,6 +304,8 @@ void AnimationManager::loadAnimations(Resource *res) {
Animation *AnimationManager::setAnimation(int animId) {
Animation *anim = findAnimation(animId);
+ if (!anim)
+ return nullptr;
anim->_countdownTicks = anim->_initialTicks;
anim->_frameNumber = 0;
@@ -320,7 +322,7 @@ void AnimationManager::setAnimTimer(Animation *anim) {
}
Animation *AnimationManager::findAnimation(int animId) {
- _animStart = _animation->getAnimation(animId);
+ _animStart = (_animation == nullptr) ? nullptr : _animation->getAnimation(animId);
return _animStart;
}
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index 89c8a4d0e6..b7ee4d2278 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -391,7 +391,9 @@ void Scripts::cmdCheckLoc() {
void Scripts::cmdSetAnim() {
int animId = _data->readByte();
Animation *anim = _vm->_animation->setAnimation(animId);
- _vm->_animation->setAnimTimer(anim);
+
+ if (anim)
+ _vm->_animation->setAnimTimer(anim);
}
void Scripts::cmdDispInv() {