forked from mirror/openmw-tes3mp
getHitContact Head exception fix
This commit is contained in:
parent
cc3bfe2bb2
commit
988a9cad58
4 changed files with 13 additions and 17 deletions
|
@ -1158,10 +1158,10 @@ bool CharacterController::updateWeaponState()
|
||||||
effect = store.get<ESM::MagicEffect>().find(effectentry.mEffectID);
|
effect = store.get<ESM::MagicEffect>().find(effectentry.mEffectID);
|
||||||
|
|
||||||
const ESM::Static* castStatic = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>().find ("VFX_Hands");
|
const ESM::Static* castStatic = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>().find ("VFX_Hands");
|
||||||
if (mAnimation->hasNode("Bip01 L Hand"))
|
if (mAnimation->getNode("Bip01 L Hand"))
|
||||||
mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 L Hand", effect->mParticle);
|
mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 L Hand", effect->mParticle);
|
||||||
|
|
||||||
if (mAnimation->hasNode("Bip01 R Hand"))
|
if (mAnimation->getNode("Bip01 R Hand"))
|
||||||
mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 R Hand", effect->mParticle);
|
mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 R Hand", effect->mParticle);
|
||||||
|
|
||||||
switch(effectentry.mRange)
|
switch(effectentry.mRange)
|
||||||
|
|
|
@ -1136,19 +1136,14 @@ namespace MWRender
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Animation::hasNode(const std::string &name) const
|
|
||||||
{
|
|
||||||
std::string lowerName = Misc::StringUtils::lowerCase(name);
|
|
||||||
return (mNodeMap.find(lowerName) != mNodeMap.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
const osg::Node* Animation::getNode(const std::string &name) const
|
const osg::Node* Animation::getNode(const std::string &name) const
|
||||||
{
|
{
|
||||||
std::string lowerName = Misc::StringUtils::lowerCase(name);
|
std::string lowerName = Misc::StringUtils::lowerCase(name);
|
||||||
NodeMap::const_iterator found = mNodeMap.find(lowerName);
|
NodeMap::const_iterator found = mNodeMap.find(lowerName);
|
||||||
if (found == mNodeMap.end())
|
if (found == mNodeMap.end())
|
||||||
throw std::runtime_error("Can't find node " + name);
|
return NULL;
|
||||||
return found->second;
|
else
|
||||||
|
return found->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Animation::AnimationTime::getValue(osg::NodeVisitor*)
|
float Animation::AnimationTime::getValue(osg::NodeVisitor*)
|
||||||
|
|
|
@ -367,11 +367,7 @@ public:
|
||||||
/// This is typically called as part of runAnimation, but may be called manually if needed.
|
/// This is typically called as part of runAnimation, but may be called manually if needed.
|
||||||
void updateEffects(float duration);
|
void updateEffects(float duration);
|
||||||
|
|
||||||
/// Is there a node with the specified name?
|
/// Return a node with the specified name, or NULL if not existing.
|
||||||
/// @note The matching is case-insensitive.
|
|
||||||
bool hasNode(const std::string& name) const;
|
|
||||||
|
|
||||||
/// Return a node with the specified name, throws an exception if the node is not found.
|
|
||||||
/// @note The matching is case-insensitive.
|
/// @note The matching is case-insensitive.
|
||||||
const osg::Node* getNode(const std::string& name) const;
|
const osg::Node* getNode(const std::string& name) const;
|
||||||
|
|
||||||
|
|
|
@ -363,8 +363,13 @@ namespace MWRender
|
||||||
mCamera->removeUpdateCallback(mUpdateCameraCallback);
|
mCamera->removeUpdateCallback(mUpdateCameraCallback);
|
||||||
|
|
||||||
const osg::Node* head = mAnimation->getNode("Bip01 Head");
|
const osg::Node* head = mAnimation->getNode("Bip01 Head");
|
||||||
mUpdateCameraCallback = new UpdateCameraCallback(head, mPosition, mLookAt);
|
if (head)
|
||||||
mCamera->addUpdateCallback(mUpdateCameraCallback);
|
{
|
||||||
|
mUpdateCameraCallback = new UpdateCameraCallback(head, mPosition, mLookAt);
|
||||||
|
mCamera->addUpdateCallback(mUpdateCameraCallback);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
std::cerr << "Error: Bip01 Head node not found" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue