Always create a skeleton if there's an "ArrowBone" node (Fixes #2117)

loadfix
scrawl 10 years ago
parent 414f7ea02c
commit c1e6b8608b

@ -55,6 +55,7 @@ void WeaponAnimation::attachArrow(MWWorld::Ptr actor)
return; return;
std::string model = ammo->getClass().getModel(*ammo); std::string model = ammo->getClass().getModel(*ammo);
assert(weapon->mSkelBase && "Need a skeleton to attach the arrow to");
mAmmunition = NifOgre::Loader::createObjects(weapon->mSkelBase, "ArrowBone", weapon->mSkelBase->getParentSceneNode(), model); mAmmunition = NifOgre::Loader::createObjects(weapon->mSkelBase, "ArrowBone", weapon->mSkelBase->getParentSceneNode(), model);
configureAddedObject(mAmmunition, *ammo, MWWorld::InventoryStore::Slot_Ammunition); configureAddedObject(mAmmunition, *ammo, MWWorld::InventoryStore::Slot_Ammunition);
} }

@ -111,7 +111,7 @@ bool NIFSkeletonLoader::needSkeleton(const Nif::Node *node)
/* We need to be a little aggressive here, since some NIFs have a crap-ton /* We need to be a little aggressive here, since some NIFs have a crap-ton
* of nodes and Ogre only supports 256 bones. We will skip a skeleton if: * of nodes and Ogre only supports 256 bones. We will skip a skeleton if:
* There are no bones used for skinning, there are no keyframe controllers, there * There are no bones used for skinning, there are no keyframe controllers, there
* are no nodes named "AttachLight", and the tree consists of NiNode, * are no nodes named "AttachLight" or "ArrowBone", and the tree consists of NiNode,
* NiTriShape, and RootCollisionNode types only. * NiTriShape, and RootCollisionNode types only.
*/ */
if(node->boneTrafo) if(node->boneTrafo)
@ -126,7 +126,7 @@ bool NIFSkeletonLoader::needSkeleton(const Nif::Node *node)
} while(!(ctrl=ctrl->next).empty()); } while(!(ctrl=ctrl->next).empty());
} }
if (node->name == "AttachLight") if (node->name == "AttachLight" || node->name == "ArrowBone")
return true; return true;
if(node->recType == Nif::RC_NiNode || node->recType == Nif::RC_RootCollisionNode) if(node->recType == Nif::RC_NiNode || node->recType == Nif::RC_RootCollisionNode)

Loading…
Cancel
Save