mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 10:06:42 +00:00
Alternative fix to mesh crash bug
This commit is contained in:
parent
d911653846
commit
d32563063b
1 changed files with 12 additions and 6 deletions
|
@ -767,14 +767,20 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
|
||||||
|
|
||||||
if (!skel.isNull()) //if there is a skeleton
|
if (!skel.isNull()) //if there is a skeleton
|
||||||
{
|
{
|
||||||
bone = skel->createBone(node->name.toString());
|
std::string name = node->name.toString();
|
||||||
|
// Quick-n-dirty workaround for the fact that several
|
||||||
|
// bones may have the same name.
|
||||||
|
if(!skel->hasBone(name))
|
||||||
|
{
|
||||||
|
bone = skel->createBone(name);
|
||||||
|
|
||||||
if (parentBone)
|
if (parentBone)
|
||||||
parentBone->addChild(bone);
|
parentBone->addChild(bone);
|
||||||
|
|
||||||
bone->setInheritOrientation(true);
|
bone->setInheritOrientation(true);
|
||||||
bone->setPosition(convertVector3(node->trafo->pos));
|
bone->setPosition(convertVector3(node->trafo->pos));
|
||||||
bone->setOrientation(convertRotation(node->trafo->rotation));
|
bone->setOrientation(convertRotation(node->trafo->rotation));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue