mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-02 18:41:33 +00:00
Fix NiSkinData loading for >4.2.1.0
This commit is contained in:
parent
1b5e904285
commit
a983977e6a
1 changed files with 9 additions and 5 deletions
|
@ -338,9 +338,9 @@ namespace Nif
|
|||
&& nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 0))
|
||||
partitions.read(nif);
|
||||
|
||||
// Has vertex weights flag
|
||||
if (nif->getVersion() > NIFStream::generateVersion(4, 2, 1, 0) && !nif->getBoolean())
|
||||
return;
|
||||
bool hasVertexWeights = true;
|
||||
if (nif->getVersion() > NIFStream::generateVersion(4, 2, 1, 0))
|
||||
hasVertexWeights = nif->getBoolean();
|
||||
|
||||
bones.resize(boneNum);
|
||||
for (BoneInfo& bi : bones)
|
||||
|
@ -351,8 +351,12 @@ namespace Nif
|
|||
bi.boundSphereCenter = nif->getVector3();
|
||||
bi.boundSphereRadius = nif->getFloat();
|
||||
|
||||
// Number of vertex weights
|
||||
bi.weights.resize(nif->getUShort());
|
||||
size_t numVertices = nif->getUShort();
|
||||
|
||||
if (!hasVertexWeights)
|
||||
continue;
|
||||
|
||||
bi.weights.resize(numVertices);
|
||||
for (size_t j = 0; j < bi.weights.size(); j++)
|
||||
{
|
||||
bi.weights[j].vertex = nif->getUShort();
|
||||
|
|
Loading…
Reference in a new issue