From 6450c9be27a1a16683c658e93ecc47c80a4a7b7b Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 22 Aug 2016 22:57:56 +0200 Subject: [PATCH] Simplify condition --- apps/openmw/mwmechanics/character.cpp | 4 ++-- apps/openmw/mwrender/animation.cpp | 8 -------- apps/openmw/mwrender/animation.hpp | 2 -- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 5310dfdbb..be321ce28 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1533,8 +1533,8 @@ void CharacterController::update(float duration) updateMagicEffects(); - if(mAnimQueue.size() > 1 && (mAnimation->getLoopingEnabled(mAnimQueue.front().mGroup) == true)) - mAnimation->setLoopingEnabled(mAnimQueue.front().mGroup, false); + if(!mAnimQueue.empty()) + mAnimation->setLoopingEnabled(mAnimQueue.front().mGroup, mAnimQueue.size() <= 1); if(!cls.isActor()) { diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 03370e7f8..a0b68fd6c 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1106,14 +1106,6 @@ namespace MWRender state->second.mLoopingEnabled = enabled; } - bool Animation::getLoopingEnabled(const std::string &groupname) const - { - AnimStateMap::const_iterator state(mStates.find(groupname)); - if(state != mStates.end()) - return state->second.mLoopingEnabled; - return false; - } - void Animation::setObjectRoot(const std::string &model, bool forceskeleton, bool baseonly, bool isCreature) { osg::ref_ptr previousStateset; diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 2eb857cbd..4eeb5d943 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -435,8 +435,6 @@ public: void setLoopingEnabled(const std::string &groupname, bool enabled); - bool getLoopingEnabled(const std::string &groupname) const; - /// This is typically called as part of runAnimation, but may be called manually if needed. void updateEffects(float duration);