mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-19 12:39:42 +00:00
Potential crash fix, either way should have a better error message now
This commit is contained in:
parent
ec64f1a53a
commit
2bcbc6ab7d
2 changed files with 7 additions and 1 deletions
|
@ -45,7 +45,12 @@ void animateCollisionShapes (std::map<OEngine::Physic::RigidBody*, OEngine::Phys
|
||||||
it != map.end(); ++it)
|
it != map.end(); ++it)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaHandle(it->first->mName);
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaHandle(it->first->mName);
|
||||||
|
if (ptr.isEmpty()) // Shouldn't happen
|
||||||
|
throw std::runtime_error("can't find Ptr");
|
||||||
|
|
||||||
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
||||||
|
if (!animation) // Shouldn't happen either, since keyframe-controlled objects are not batched in StaticGeometry
|
||||||
|
throw std::runtime_error("can't find Animation for " + ptr.getCellRef().getRefId());
|
||||||
|
|
||||||
OEngine::Physic::AnimatedShapeInstance& instance = it->second;
|
OEngine::Physic::AnimatedShapeInstance& instance = it->second;
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,8 @@ void ManualBulletShapeLoader::handleNode(const Nif::Node *node, int flags,
|
||||||
// the flags we currently use, at least.
|
// the flags we currently use, at least.
|
||||||
flags |= node->flags;
|
flags |= node->flags;
|
||||||
|
|
||||||
if (!node->controller.empty() && node->controller->recType == Nif::RC_NiKeyframeController)
|
if (!node->controller.empty() && node->controller->recType == Nif::RC_NiKeyframeController
|
||||||
|
&& (node->controller->flags & Nif::NiNode::ControllerFlag_Active))
|
||||||
isAnimated = true;
|
isAnimated = true;
|
||||||
|
|
||||||
if (!raycasting)
|
if (!raycasting)
|
||||||
|
|
Loading…
Reference in a new issue