Index: trunk/src/lib/coord/p_node.cc
===================================================================
--- trunk/src/lib/coord/p_node.cc	(revision 6634)
+++ trunk/src/lib/coord/p_node.cc	(revision 6695)
@@ -42,4 +42,5 @@
  */
 PNode::PNode (PNode* parent, long nodeFlags)
+  : Synchronizeable(), BaseObject()
 {
   this->setClassID(CL_PARENT_NODE, "PNode");
@@ -487,4 +488,14 @@
       this->children.push_back(child);
     child->parentCoorChanged();
+
+//     if(this->getUniqueID() == NET_UID_UNASSIGNED)
+//     {
+//       PRINTF(1)("Adding to an UNASSIGNED PNode - looking for next assigned Node\n");
+//       PNode* node = this->seekNextAssignedPNode(this);
+//       if( node == NULL)
+//         PRINTF(1)("    Got NULL - Is this the NULLParent - uid %i\n", this->getUniqueID());
+//       else
+//         PRINTF(1)("    Found next assigned node: %i\n", node->getUniqueID());
+//     }
   }
   else
@@ -495,4 +506,21 @@
     child->parentCoorChanged();
   }
+}
+
+
+PNode* PNode::seekNextAssignedPNode(PNode* node) const
+{
+  PNode* tmpNode = node->parent;
+  printf("entering seek PNode loop for name: %s, uid: %i\n", node->getName(), node->getUniqueID());
+  if(tmpNode)
+    printf("  @node name: %s, uid: %d\n", tmpNode->getName(), tmpNode->getUniqueID());
+  while( tmpNode != NULL && tmpNode->getUniqueID() == NET_UID_UNASSIGNED)
+  {
+    printf("  @node name: %s, uid: %d\n", tmpNode->getName(), tmpNode->getUniqueID());
+    tmpNode = tmpNode->parent;
+  }
+  printf("leaving PNode loop\n\n");
+
+  return tmpNode;
 }
 
@@ -695,5 +723,7 @@
   {
     PNode::nullParent = new PNode(NULL, PNODE_PARENT_MODE_DEFAULT | PNODE_REPARENT_TO_NULL);
+    PNode::nullParent->setClassID(CL_NULL_PARENT, "NullParent");
     PNode::nullParent->setName("NullParent");
+    PNode::nullParent->setSynchronized(true);
   }
   return PNode::nullParent;
@@ -1049,17 +1079,17 @@
   SYNCHELP_READ_FKT( BaseObject::writeState );
 
-  char * parentName = NULL;
-  SYNCHELP_READ_STRINGM( parentName );
-
-  if ( strcmp(parentName, "")==0 )
-  {
-    setParent( (char*)NULL );
-  }
-  else
-  {
-    setParent( parentName );
-  }
-
-  delete[] parentName;
+//   char * parentName = NULL;
+//   SYNCHELP_READ_STRINGM( parentName );
+//
+//   if ( strcmp(parentName, "")==0 )
+//   {
+//     setParent( (char*)NULL );
+//   }
+//   else
+//   {
+//     setParent( parentName );
+//   }
+//
+//  delete[] parentName;
 
   int parentMode;
@@ -1081,19 +1111,19 @@
   this->setRelDir( Quaternion( Vector(f2, f3, f4), f1 ) );
 
-  int n;
-  char * childName;
-
-  PRINTF(0)("JKLO %d %d %d %d\n", data[__synchelp_read_i], data[__synchelp_read_i+1], data[__synchelp_read_i+2], data[__synchelp_read_i+3]);
-  SYNCHELP_READ_INT( n );
-  PRINTF(0)("read %s:n=%d\n", this->getName(), n);
-
-  for (int i = 0; i<n; i++)
-  {
-    SYNCHELP_READ_STRINGM( childName );
-    PRINTF(0)("RCVD CHILD = %s\n", childName);
-    addChild( childName );
-    delete childName;
-    childName = NULL;
-  }
+//   int n;
+//   char * childName;
+//
+//   PRINTF(0)("JKLO %d %d %d %d\n", data[__synchelp_read_i], data[__synchelp_read_i+1], data[__synchelp_read_i+2], data[__synchelp_read_i+3]);
+//   SYNCHELP_READ_INT( n );
+//   PRINTF(0)("read %s:n=%d\n", this->getName(), n);
+//
+//   for (int i = 0; i<n; i++)
+//   {
+//     SYNCHELP_READ_STRINGM( childName );
+//     PRINTF(0)("RCVD CHILD = %s\n", childName);
+//     addChild( childName );
+//     delete childName;
+//     childName = NULL;
+//   }
 
   return SYNCHELP_READ_N;
@@ -1112,12 +1142,12 @@
   SYNCHELP_WRITE_FKT( BaseObject::readState );
 
-  if ( this->parent )
-  {
-    SYNCHELP_WRITE_STRING( parent->getName() );
-  }
-  else
-  {
-    SYNCHELP_WRITE_STRING( "" );
-  }
+//   if ( this->parent )
+//   {
+//     SYNCHELP_WRITE_STRING( parent->getName() );
+//   }
+//   else
+//   {
+//     SYNCHELP_WRITE_STRING( "" );
+//   }
 
   SYNCHELP_WRITE_INT( this->parentMode );
@@ -1132,25 +1162,25 @@
   SYNCHELP_WRITE_FLOAT( this->relDirection.v.z );
 
-  int n = children.size();
-
-  //check if camera is in children
-  for (std::list<PNode*>::const_iterator it = children.begin(); it!=children.end(); it++)
-  {
-    if ( (*it)->isA(CL_CAMERA) )
-      n--;
-  }
-  PRINTF(0)("write %s:n=%d\n", this->getName(), n);
-  SYNCHELP_WRITE_INT( n );
-  PRINTF(0)("ASDF %d %d %d %d\n", data[__synchelp_write_i-4], data[__synchelp_write_i-3], data[__synchelp_write_i-2], data[__synchelp_write_i-1]);
-
-  for (std::list<PNode*>::const_iterator it = children.begin(); it!=children.end(); it++)
-  {
-    //dont add camera because there is only one camera attached to local player
-    if ( !(*it)->isA(CL_CAMERA) )
-    {
-      PRINTF(0)("SENDING CHILD: %s\n", (*it)->getName());
-      SYNCHELP_WRITE_STRING( (*it)->getName() );
-    }
-  }
+//   int n = children.size();
+//   //check if camera is in children
+//   for (std::list<PNode*>::const_iterator it = children.begin(); it!=children.end(); it++)
+//   {
+//     if ( (*it)->isA(CL_CAMERA) )
+//       n--;
+//   }
+//   PRINTF(0)("write %s:n=%d\n", this->getName(), n);
+//   SYNCHELP_WRITE_INT( n );
+//   PRINTF(0)("ASDF %d %d %d %d\n", data[__synchelp_write_i-4], data[__synchelp_write_i-3], data[__synchelp_write_i-2], data[__synchelp_write_i-1]);
+//
+//
+//   for (std::list<PNode*>::const_iterator it = children.begin(); it!=children.end(); it++)
+//   {
+//     //dont add camera because there is only one camera attached to local player
+//     if ( !(*it)->isA(CL_CAMERA) )
+//     {
+//       PRINTF(0)("SENDING CHILD: %s\n", (*it)->getName());
+//       SYNCHELP_WRITE_STRING( (*it)->getName() );
+//     }
+//   }
 
   return SYNCHELP_WRITE_N;
Index: trunk/src/lib/coord/p_node.h
===================================================================
--- trunk/src/lib/coord/p_node.h	(revision 6634)
+++ trunk/src/lib/coord/p_node.h	(revision 6695)
@@ -147,4 +147,6 @@
   void removeNode();
 
+  PNode* seekNextAssignedPNode(PNode* node) const;
+
   /** @param parent the new parent of this node */
   inline void setParent (PNode* parent) { parent->addChild(this); };
