Potential crash fix, either way should have a better error message now

deque
scrawl 11 years ago
parent ec64f1a53a
commit 2bcbc6ab7d

@ -45,7 +45,12 @@ void animateCollisionShapes (std::map<OEngine::Physic::RigidBody*, OEngine::Phys
it != map.end(); ++it)
{
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);
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;

@ -181,7 +181,8 @@ void ManualBulletShapeLoader::handleNode(const Nif::Node *node, int flags,
// the flags we currently use, at least.
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;
if (!raycasting)

Loading…
Cancel
Save