diff options
author | Robert Špalek | 2009-10-12 00:39:49 +0000 |
---|---|---|
committer | Robert Špalek | 2009-10-12 00:39:49 +0000 |
commit | ca35af26976c0499b83ff3b434ae3d7b9eaef33f (patch) | |
tree | a80b918e42a6707439cc04858825a834a2a143af | |
parent | b99e69f4d9a4ec864d5b6f26787d1841e4bdc56d (diff) | |
download | scummvm-rg350-ca35af26976c0499b83ff3b434ae3d7b9eaef33f.tar.gz scummvm-rg350-ca35af26976c0499b83ff3b434ae3d7b9eaef33f.tar.bz2 scummvm-rg350-ca35af26976c0499b83ff3b434ae3d7b9eaef33f.zip |
Fixed funcActPhase()
svn-id: r44963
-rw-r--r-- | engines/draci/script.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index a090ee6b86..03ce26eec1 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -338,13 +338,13 @@ int Script::funcActPhase(int objID) const { bool visible = (obj->_location == _vm->_game->getRoomNum() && obj->_visible); if (objID == kDragonObject || visible) { - // FIXME: we should check which animation is active and return - // the phase of it, instead of the first one. this function - // is only used at 3 places of the game, hence possible - // breakage may not show easily. - int animID = obj->_anim[0]; - Animation *anim = _vm->_anims->getAnimation(animID); - ret = anim->currentFrameNum(); + for (uint i = 0; i < obj->_anim.size(); ++i) { + int animID = obj->_anim[i]; + Animation *anim = _vm->_anims->getAnimation(animID); + if (anim && anim->isPlaying()) { + ret = anim->currentFrameNum(); + } + } } return ret; |