Index: orxonox/branches/parenting/src/Makefile.in
===================================================================
--- orxonox/branches/parenting/src/Makefile.in	(revision 3353)
+++ orxonox/branches/parenting/src/Makefile.in	(revision 3354)
@@ -296,7 +296,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  src/Makefile
+	  $(AUTOMAKE) --gnu  src/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Index: orxonox/branches/parenting/src/track_manager.cc
===================================================================
--- orxonox/branches/parenting/src/track_manager.cc	(revision 3353)
+++ orxonox/branches/parenting/src/track_manager.cc	(revision 3354)
@@ -29,4 +29,5 @@
 {
   this->isFresh = true;
+  this->isHotPoint = false;
   this->isSavePoint = false;
   this->isFork = false;
@@ -99,5 +100,5 @@
 
 */
-TrackManager::TrackManager () 
+TrackManager::TrackManager(void)
 {
   this->setClassName ("TrackManager");
@@ -117,5 +118,5 @@
 
 */
-TrackManager::~TrackManager () 
+TrackManager::~TrackManager(void)
 {
   PRINTF(3)("Destruct TrackManager\n");
@@ -180,4 +181,5 @@
 {
   this->currentTrackElem = findTrackElementByID(trackID);
+  printf("now Working on %d\n", trackID);
 }
 
@@ -252,4 +254,5 @@
 int TrackManager::addHotPoint(Vector newPoint)
 {
+  printf("setting up a HotPoint\n");
   if (this->currentTrackElem->isFresh)
     {
@@ -261,4 +264,6 @@
   this->currentTrackElem->curve->addNode(newPoint);
   this->currentTrackElem->nodeCount++;
+  this->initChildren(1);
+  this->currentTrackElem = this->currentTrackElem->children[0];
 }
 
@@ -272,7 +277,9 @@
 int TrackManager::setSavePoint(void)
 {
+  printf("setting up a SavePoint.\n");
   if (this->currentTrackElem->isFork || this->currentTrackElem->isSavePoint)
     return this->currentTrackElem->children[1]->ID;
   this->currentTrackElem->isSavePoint = true;
+  this->currentTrackElem->isHotPoint = true;
 
   this->initChildren(1);
@@ -312,7 +319,9 @@
 void TrackManager::forkV(unsigned int count, int* trackIDs)
 {
+  printf("Forking with %d children\n", count);
   if (this->currentTrackElem->isSavePoint)
     return;
   this->currentTrackElem->isFork = true;
+  this->currentTrackElem->isHotPoint = true;
   for(int i = 0; i < count; i++)
     trackIDs[i]=this->trackElemCount+1+i;
@@ -335,5 +344,5 @@
 
    Join will set the localTime to the longest time a Path has to get to this Point. \n
-   Join will join all curves to the curve we are working on, meaning that all the tangents will be matched.
+   Join will join all curves to the first curve, meaning that all the tangents will be matched.
 */
 void TrackManager::join(unsigned int count, ...)
@@ -360,16 +369,38 @@
 void TrackManager::joinV(unsigned int count, int* trackIDs)
 {
-  Vector tmpEndPoint = this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount());
-  Vector tmpTangentPoint = this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()-1); 
-  
-  for (int i = 0; i < count; i++)
+  printf("Joining %d tracks to Track %d\n", count, trackIDs[0]);
+
+  // chanching work-on to temporary value. going back at the end.
+  int tmpCurrentWorkingID = this->currentTrackElem->ID;
+  this->workOn(trackIDs[0]);
+
+  TrackElement* firstJoint = this->currentTrackElem;
+  Vector tmpEndPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount());
+  Vector tmpTangentPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()-1); 
+  firstJoint->isJoined = true;
+  if(!firstJoint->isHotPoint)
+    this->setSavePoint();
+
+  for (int i = 1; i < count; i++)
     {
       TrackElement* tmpJoinElem = this->findTrackElementByID(trackIDs[i]);
-      this->addPoint(tmpTangentPoint, tmpJoinElem);
-      this->addPoint(tmpEndPoint, tmpJoinElem);
-      tmpJoinElem->isJoined = true;
-    }
-  this->currentTrackElem->isJoined = true;
-
+      if (tmpJoinElem->childCount > 0)
+	printf("!!This Curve has children, and as such will not be joined!!\n You can try joining other childless TrackElements to this one!");
+      else
+	{
+	  this->addPoint(tmpTangentPoint, tmpJoinElem);
+	  this->addPoint(tmpEndPoint, tmpJoinElem);
+	  
+	  //Copying Joint-Info
+	  tmpJoinElem->children = firstJoint->children;
+	  tmpJoinElem->childCount = firstJoint->childCount;
+	  tmpJoinElem->isSavePoint = firstJoint->isSavePoint;
+	  tmpJoinElem->isFork = firstJoint->isFork;
+	  
+	  tmpJoinElem->isJoined = true;
+	}
+    }
+  // returning to the TrackElement we were working on.
+  this->workOn(tmpCurrentWorkingID);
 }
 
@@ -477,22 +508,30 @@
 	  if(tmpElem->name)
 	    printf("name:%s::", tmpElem->name);
+	  if(tmpElem->isFresh)
+	    printf("   has not jet eddited in any way\n");
 	  printf("\n   TimeTable: starting at = %f; ends at = %f; duration = %f\n", tmpElem->startingTime, tmpElem->startingTime+tmpElem->duration, tmpElem->duration);
 	  printf("   consists of %d Points\n", tmpElem->nodeCount);
-
-	  if(tmpElem->isFresh)
-	    printf("   has not jet eddited in any way\n");
-	  if(tmpElem->isSavePoint)
-	    printf("   is a SavePoint\n");
-	  if(tmpElem->isFork)
+	  if (tmpElem->childCount == 0)
+	    printf("   has no child\n");	    
+	  else if (tmpElem->childCount == 1)
+	    printf("   has 1 child: ==%d==\n", tmpElem->children[0]->ID);
+	  else if (tmpElem->childCount > 1)
 	    {
-	      printf("   is A Fork with with %d children: ", tmpElem->childCount);
+	      printf("   has %d children: ", tmpElem->childCount);
 	      for(int i = 0; i < tmpElem->childCount; i++)
 		printf("=%d= ", tmpElem->children[i]->ID);
 	      printf("\n");
 	    }
+
+	  if(tmpElem->isHotPoint)
+	    printf("   is a special Point:\n");
+	  if(tmpElem->isSavePoint)
+	    printf("    is a SavePoint\n");
+	  if(tmpElem->isFork)
+	    {
+	      printf("    is A Fork with with %d children.", tmpElem->childCount);
+	    }
 	  if(tmpElem->isJoined)
 	    printf("   is Joined at the End\n");
-
-		   
 	}
     }
Index: orxonox/branches/parenting/src/track_manager.h
===================================================================
--- orxonox/branches/parenting/src/track_manager.h	(revision 3353)
+++ orxonox/branches/parenting/src/track_manager.h	(revision 3354)
@@ -36,4 +36,5 @@
 
   bool isFresh;              //!< If no Points where added until now
+  bool isHotPoint;           //!< If the first node is a specialPoint;
   bool isSavePoint;          //!< If the first node is a savePoint
   bool isFork;               //!< If the first node is a Fork
Index: orxonox/branches/parenting/src/world.cc
===================================================================
--- orxonox/branches/parenting/src/world.cc	(revision 3353)
+++ orxonox/branches/parenting/src/world.cc	(revision 3354)
@@ -246,5 +246,4 @@
       int fork11, fork12;
       trackManager->fork(2, &fork11, &fork12);
-      printf("FORKS: %d, %d\n", fork11, fork12);
       trackManager->workOn(fork11);
       trackManager->addPoint(Vector(170, 0, -15));
@@ -255,5 +254,10 @@
       trackManager->addPoint(Vector(190,2,5));
       trackManager->addPoint(Vector(200,2,5));
-      trackManager->join(2, fork11, fork12);
+      trackManager->setSavePoint();
+      trackManager->addPoint(Vector(220, 10,-10));
+      trackManager->addPoint(Vector(230, 0,-10));
+      trackManager->addPoint(Vector(240, 0, 2));
+      trackManager->addPoint(Vector(250, 0, 0));
+      trackManager->join(2, fork12, fork11);
       
       /*
