Fix error message that referred to the wrong file (Bug #4159)

pull/1491/merge
scrawl 7 years ago
parent 1afbf99f74
commit b06512a60d

@ -536,7 +536,7 @@ namespace MWRender
return mKeyframes->mTextKeys;
}
void Animation::addAnimSource(const std::string &model)
void Animation::addAnimSource(const std::string &model, const std::string& baseModel)
{
std::string kfname = model;
Misc::StringUtils::lowerCaseInPlace(kfname);
@ -565,7 +565,7 @@ namespace MWRender
NodeMap::const_iterator found = nodeMap.find(bonename);
if (found == nodeMap.end())
{
std::cerr << "Warning: addAnimSource: can't find bone '" + bonename << "' in " << model << " (referenced by " << kfname << ")" << std::endl;
std::cerr << "Warning: addAnimSource: can't find bone '" + bonename << "' in " << baseModel << " (referenced by " << kfname << ")" << std::endl;
continue;
}
@ -1668,7 +1668,7 @@ namespace MWRender
{
setObjectRoot(model, false, false, false);
if (animated)
addAnimSource(model);
addAnimSource(model, model);
if (!ptr.getClass().getEnchantment(ptr).empty())
addGlow(mObjectRoot, getEnchantmentColor(ptr));

@ -309,11 +309,12 @@ protected:
*/
void setObjectRoot(const std::string &model, bool forceskeleton, bool baseonly, bool isCreature);
/** Adds the keyframe controllers in the specified model as a new animation source. Note that the .nif
* file extension will be replaced with .kf.
/** Adds the keyframe controllers in the specified model as a new animation source.
* @note Later added animation sources have the highest priority when it comes to finding a particular animation.
* @param model The file to add the keyframes for. Note that the .nif file extension will be replaced with .kf.
* @param baseModel The filename of the mObjectRoot, only used for error messages.
*/
void addAnimSource(const std::string &model);
void addAnimSource(const std::string &model, const std::string& baseModel);
/** Adds an additional light to the given node using the specified ESM record. */
void addExtraLight(osg::ref_ptr<osg::Group> parent, const ESM::Light *light);

@ -33,8 +33,8 @@ CreatureAnimation::CreatureAnimation(const MWWorld::Ptr &ptr,
setObjectRoot(model, false, false, true);
if((ref->mBase->mFlags&ESM::Creature::Bipedal))
addAnimSource("meshes\\xbase_anim.nif");
addAnimSource(model);
addAnimSource("meshes\\xbase_anim.nif", model);
addAnimSource(model, model);
}
}
@ -51,8 +51,8 @@ CreatureWeaponAnimation::CreatureWeaponAnimation(const MWWorld::Ptr &ptr, const
setObjectRoot(model, true, false, true);
if((ref->mBase->mFlags&ESM::Creature::Bipedal))
addAnimSource("meshes\\xbase_anim.nif");
addAnimSource(model);
addAnimSource("meshes\\xbase_anim.nif", model);
addAnimSource(model, model);
mPtr.getClass().getInventoryStore(mPtr).setInvListener(this, mPtr);

@ -482,25 +482,25 @@ void NpcAnimation::updateNpcBase()
{
const std::string base = "meshes\\xbase_anim.nif";
if (smodel != base)
addAnimSource(base);
addAnimSource(base, smodel);
addAnimSource(smodel);
addAnimSource(smodel, smodel);
if(!isWerewolf)
{
if(mNpc->mModel.length() > 0)
addAnimSource(Misc::ResourceHelpers::correctActorModelPath("meshes\\" + mNpc->mModel, mResourceSystem->getVFS()));
addAnimSource(Misc::ResourceHelpers::correctActorModelPath("meshes\\" + mNpc->mModel, mResourceSystem->getVFS()), smodel);
if(Misc::StringUtils::lowerCase(mNpc->mRace).find("argonian") != std::string::npos)
addAnimSource("meshes\\xargonian_swimkna.nif");
addAnimSource("meshes\\xargonian_swimkna.nif", smodel);
}
}
else
{
const std::string base = "meshes\\xbase_anim.1st.nif";
if (smodel != base)
addAnimSource(base);
addAnimSource(base, smodel);
addAnimSource(smodel);
addAnimSource(smodel, smodel);
mObjectRoot->setNodeMask(Mask_FirstPerson);
mObjectRoot->addCullCallback(new OverrideFieldOfViewCallback(mFirstPersonFieldOfView));

Loading…
Cancel
Save