Skip to content

Commit

Permalink
ACCESS: Workaround for original setting animations when none is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 13, 2014
1 parent 60ee545 commit 968bfec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion engines/access/animation.cpp
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
4 changes: 3 additions & 1 deletion engines/access/scripts.cpp
Expand Up @@ -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() {
Expand Down

0 comments on commit 968bfec

Please sign in to comment.