Skip to content
Snippets Groups Projects
Commit c4b12611 authored by Tazpn's avatar Tazpn
Browse files

niflib: Fix issue with changes for new condition engine regarding userversion == 0.

parent 28aac34e
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,9 @@ protected:
vector<int > vertexIndices;
public:
NIFLIB_API string GetName();
NIFLIB_API void SetName( const string & new_name );
//--Counts--//
/*!
......
......@@ -63,7 +63,7 @@ void NiBoneLODController::Read( istream& in, list<unsigned int> & link_stack, co
link_stack.push_back( block_num );
};
};
if ( info.version >= 0x04020200 ) {
if ( ( info.version >= 0x04020200 ) && ( info.userVersion == 0 ) ) {
NifStream( numShapeGroups, in, info );
shapeGroups1.resize(numShapeGroups);
for (unsigned int i2 = 0; i2 < shapeGroups1.size(); i2++) {
......@@ -114,7 +114,7 @@ void NiBoneLODController::Write( ostream& out, const map<NiObjectRef,unsigned in
}
};
};
if ( info.version >= 0x04020200 ) {
if ( ( info.version >= 0x04020200 ) && ( info.userVersion == 0 ) ) {
NifStream( numShapeGroups, out, info );
for (unsigned int i2 = 0; i2 < shapeGroups1.size(); i2++) {
shapeGroups1[i2].numLinkPairs = (unsigned int)(shapeGroups1[i2].linkPairs.size());
......@@ -240,7 +240,7 @@ void NiBoneLODController::FixLinks( const map<unsigned int,NiObjectRef> & object
nodeGroups[i1].nodes[i2] = FixLink<NiNode>( objects, link_stack, info );
};
};
if ( info.version >= 0x04020200 ) {
if ( ( info.version >= 0x04020200 ) && ( info.userVersion == 0 ) ) {
for (unsigned int i2 = 0; i2 < shapeGroups1.size(); i2++) {
for (unsigned int i3 = 0; i3 < shapeGroups1[i2].linkPairs.size(); i3++) {
shapeGroups1[i2].linkPairs[i3].shape = FixLink<NiTriBasedGeom>( objects, link_stack, info );
......
......@@ -408,6 +408,15 @@ static void CalcCenteredSphere(const vector<Vector3>& vertices, Vector3& center,
}
}
string NiGeometryData::GetName() {
return name;
}
void NiGeometryData::SetName( const string & new_name ) {
name = new_name;
}
int NiGeometryData::GetVertexCount() const {
return int(vertices.size());
}
......
......@@ -62,7 +62,7 @@ void NiMorphData::Read( istream& in, list<unsigned int> & link_stack, const NifI
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A020000 ) ) {
NifStream( morphs[i1].unknownInt, in, info );
};
if ( ( info.version >= 0x14000004 ) && ( info.version <= 0x14010003 ) ) {
if ( ( info.version >= 0x14000004 ) && ( info.version <= 0x14010003 ) && ( info.userVersion == 0 ) ) {
NifStream( morphs[i1].unknownInt, in, info );
};
morphs[i1].vectors.resize(numVertices);
......@@ -99,7 +99,7 @@ void NiMorphData::Write( ostream& out, const map<NiObjectRef,unsigned int> & lin
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A020000 ) ) {
NifStream( morphs[i1].unknownInt, out, info );
};
if ( ( info.version >= 0x14000004 ) && ( info.version <= 0x14010003 ) ) {
if ( ( info.version >= 0x14000004 ) && ( info.version <= 0x14010003 ) && ( info.userVersion == 0 ) ) {
NifStream( morphs[i1].unknownInt, out, info );
};
for (unsigned int i2 = 0; i2 < morphs[i1].vectors.size(); i2++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment