From ca35af26976c0499b83ff3b434ae3d7b9eaef33f Mon Sep 17 00:00:00 2001 From: Robert Špalek Date: Mon, 12 Oct 2009 00:39:49 +0000 Subject: Fixed funcActPhase() svn-id: r44963 --- engines/draci/script.cpp | 14 +++++++------- 1 file 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; -- cgit v1.2.3