mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 09:15:33 +00:00
Avoid trying to play animations without any animation sources
This commit is contained in:
parent
ad6d663e09
commit
537d5c4934
1 changed files with 2 additions and 3 deletions
|
@ -554,7 +554,7 @@ bool Animation::handleTextKey(AnimState &state, const std::string &groupname, co
|
||||||
|
|
||||||
void Animation::play(const std::string &groupname, int priority, int groups, bool autodisable, float speedmult, const std::string &start, const std::string &stop, float startpoint, size_t loops)
|
void Animation::play(const std::string &groupname, int priority, int groups, bool autodisable, float speedmult, const std::string &start, const std::string &stop, float startpoint, size_t loops)
|
||||||
{
|
{
|
||||||
if(!mSkelBase)
|
if(!mSkelBase || mAnimSources.size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(groupname.empty())
|
if(groupname.empty())
|
||||||
|
@ -602,7 +602,7 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(iter == mAnimSources.rend())
|
if(iter == mAnimSources.rend())
|
||||||
std::cerr<< "Failed to find animation "<<groupname <<std::endl;
|
std::cerr<< "Failed to find animation "<<groupname<<" for "<<mPtr.getCellRef().mRefID <<std::endl;
|
||||||
|
|
||||||
resetActiveGroups();
|
resetActiveGroups();
|
||||||
}
|
}
|
||||||
|
@ -644,7 +644,6 @@ void Animation::resetActiveGroups()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const Ogre::SharedPtr<AnimSource> &animsrc = state->second.mSource;
|
const Ogre::SharedPtr<AnimSource> &animsrc = state->second.mSource;
|
||||||
|
|
||||||
const std::vector<Ogre::Controller<Ogre::Real> >&ctrls = animsrc->mControllers[0];
|
const std::vector<Ogre::Controller<Ogre::Real> >&ctrls = animsrc->mControllers[0];
|
||||||
for(size_t i = 0;i < ctrls.size();i++)
|
for(size_t i = 0;i < ctrls.size();i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue