Skip to content
Snippets Groups Projects
Commit 77ff8329 authored by Amorilia's avatar Amorilia
Browse files

FixLink update for missing_link_stack stuff.

parent 3f87684b
No related branches found
No related tags found
No related merge requests found
......@@ -17,21 +17,26 @@ const char FIX_LINK_INDEX_ERROR[] = "Object index was not found in object map.
const char FIX_LINK_CAST_ERROR[] = "Link could not be cast to required type during file read. This NIF file may be invalid or improperly supported.";
template <class T>
Ref<T> FixLink( const map<unsigned,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info ) {
Ref<T> FixLink( const map<unsigned,NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info ) {
if (link_stack.empty()) {
throw runtime_error(FIX_LINK_POP_ERROR);
}
unsigned int index = link_stack.front();
link_stack.pop_front();
NiObjectRef missing_obj;
if (!missing_link_stack.empty()) {
missing_obj = missing_link_stack.front();
missing_link_stack.pop_front();
}
//Check if link is NULL
if ( info.version > VER_3_3_0_13) {
if ( index == 0xFFFFFFFF) {
return NULL;
return DynamicCast<T>(missing_obj);
}
} else {
if ( index == 0 ) {
return NULL;
return DynamicCast<T>(missing_obj);
}
}
......
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