From 8e9bad9190c67f83a36c3bcfd93ec208158328dd Mon Sep 17 00:00:00 2001
From: Shon Ferguson <shonferg@users.sourceforge.net>
Date: Sun, 14 May 2006 04:45:02 +0000
Subject: [PATCH] Realized that it's NiAVObject that has a parent, not
 NiObjectNET.

---
 nif_objects.h | 15 +++++++--------
 niflib.cpp    |  4 ++--
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/nif_objects.h b/nif_objects.h
index 6f26ee1d..b29ecd6f 100644
--- a/nif_objects.h
+++ b/nif_objects.h
@@ -242,7 +242,7 @@ template <class T> const Ref<T> DynamicCast( const NiObject * object ) {
 const Type NiObject::TYPE("NiObject", NULL );
 
 /*
- * NiObjectNET - An object that has a name and can be parented to other objects.  Can have extra data and controllers attatched.
+ * NiObjectNET - An object that has a name.  Can have extra data and controllers attatched.
  */
 
 class NiObjectNET;
@@ -257,14 +257,7 @@ public:
 	static const Type TYPE;
 
 	string name;
-
-	void SetParent( NiObjectNETRef new_parent ) {
-		parent = new_parent;
-	}
-	NiObjectNETRef GetParent() { return parent; }
-
 private:
-	NiObjectNET * parent;
 	//TODO: pointer to extra data type... find out what that is.  AExtraData right now.  Need functions to add/remove.
 	//TODO: pointer to first NiTimeController type.  Need functions to add/remove.
 };
@@ -328,7 +321,13 @@ public:
 	 */
 	void SetWorldBindPos( Matrix44 const & m );
 
+	void SetParent( NiAVObjectRef new_parent ) {
+		parent = new_parent;
+	}
+	NiAVObjectRef GetParent() { return parent; }
+
 protected:
+	NiAVObject * parent;
 	void ResetSkinnedFlag();
 	Matrix44 bindPosition;
 
diff --git a/niflib.cpp b/niflib.cpp
index fc872ece..6c17a34e 100644
--- a/niflib.cpp
+++ b/niflib.cpp
@@ -101,9 +101,9 @@ NiObjectRef FindRoot( vector<NiObjectRef> const & blocks ) {
 	//--Look for a NiNode that has no parents--//
 
 	//Find the first NiObjectNET derived object
-	NiObjectNETRef root;
+	NiAVObjectRef root;
 	for (uint i = 0; i < blocks.size(); ++i) {
-		root = DynamicCast<NiObjectNET>(blocks[i]);
+		root = DynamicCast<NiAVObject>(blocks[i]);
 		if ( root != NULL ) {
 			break;
 		}
-- 
GitLab