Index: orxonox/trunk/src/defs/debug.h
===================================================================
--- orxonox/trunk/src/defs/debug.h	(revision 3600)
+++ orxonox/trunk/src/defs/debug.h	(revision 3601)
@@ -17,4 +17,8 @@
     \file debug.h
     \brief Handles output to console for different Verbose-Modes.
+
+    There are two main modes HARD and SOFT. HARD is precessed during compileTime where SOFT is for runtime.
+    \li HARD: One can choose between different modes. see: // DEFINE_MODULES \\
+    \li SOFT: If you want each module can have its own variable for processing. just pass it to DEBUG_MODULE_SOFT
 */ 
 
@@ -38,7 +42,15 @@
 extern int verbose;
 
+//definitions
 #ifndef MODULAR_DEBUG
 #define HARD_DEBUG_LEVEL DEBUG
+#define SOFT_DEBUG_LEVEL verbose
 #else /* MODULAR_DEBUG */
+#ifndef DEBUG_MODULE_SOFT 
+#define SOFT_DEBUG_LEVEL verbose
+#else /* DEBUG_MODULE_SOFT */
+#define SOFT_DEBUG_LEVEL DEBUG_MODULE_SOFT
+#endif /* DEBUG_MODULE_SOFT */
+
 #ifndef DEBUG_SPECIAL_MODULE
 #define HARD_DEBUG_LEVEL DEBUG
@@ -74,5 +86,5 @@
 #if HARD_DEBUG_LEVEL >= ERR
 #define PRINTF1 \
-    if (verbose >= ERR) \
+    if (SOFT_DEBUG_LEVEL >= ERR) \
       printf("ERROR::%s:%d:", __FILE__, __LINE__) && printf
 #else 
@@ -82,5 +94,5 @@
 #if HARD_DEBUG_LEVEL >= WARN
 #define PRINTF2 \
-     if (verbose >= WARN) \
+     if (SOFT_DEBUG_LEVEL >= WARN) \
        printf("WARNING::%s:%d:", __FILE__, __LINE__) && printf
          
@@ -91,5 +103,5 @@
 #if HARD_DEBUG_LEVEL >= INFO
 #define PRINTF3 \
-     if (verbose >= INFO) \
+     if (SOFT_DEBUG_LEVEL >= INFO) \
        printf("INFO::%s:%d:", __FILE__, __LINE__) && printf
 #else 
@@ -99,5 +111,5 @@
 #if HARD_DEBUG_LEVEL >= DEBUGING
 #define PRINTF4 \
-     if (verbose >= DEBUGING) \
+     if (SOFT_DEBUG_LEVEL >= DEBUGING) \
        printf("DEBUG::%s:%d:", __FILE__, __LINE__) && printf
 #else 
@@ -107,5 +119,5 @@
 #if HARD_DEBUG_LEVEL >= vDEBUGING
 #define PRINTF5 \
-     if (verbose >= vDEBUGING) \
+     if (SOFT_DEBUG_LEVEL >= vDEBUGING) \
        printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
 #else 
@@ -130,5 +142,5 @@
 #if HARD_DEBUG_LEVEL >= ERR
 #define PRINT1	\
-  if (verbose >= ERR)	\
+  if (SOFT_DEBUG_LEVEL >= ERR)	\
     printf
 #else 
@@ -138,5 +150,5 @@
 #if HARD_DEBUG_LEVEL >= WARN
 #define PRINT2 \
-  if (verbose >= WARN) \
+  if (SOFT_DEBUG_LEVEL >= WARN) \
     printf
 
@@ -147,5 +159,5 @@
 #if HARD_DEBUG_LEVEL >= INFO
 #define PRINT3 \
-  if (verbose >= INFO) \
+  if (SOFT_DEBUG_LEVEL >= INFO) \
     printf
 #else 
@@ -155,5 +167,5 @@
 #if HARD_DEBUG_LEVEL >= DEBUGING
 #define PRINT4 \
-  if (verbose >= DEBUGING) \
+  if (SOFT_DEBUG_LEVEL >= DEBUGING) \
     printf
 #else 
@@ -163,5 +175,5 @@
 #if HARD_DEBUG_LEVEL >= vDEBUGING
 #define PRINT5 \
-     if (verbose >= vDEBUGING) \
+     if (SOFT_DEBUG_LEVEL >= vDEBUGING) \
        printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
 #else 
@@ -186,5 +198,5 @@
 #if HARD_DEBUG_LEVEL >= 1
 #define COUT1 \
-    if (verbose >= 1 ) \
+    if (SOFT_DEBUG_LEVEL >= 1 ) \
       cout
 #else 
@@ -194,5 +206,5 @@
 #if HARD_DEBUG_LEVEL >= 2
 #define COUT2 \
-     if (verbose >= 2 ) \
+     if (SOFT_DEBUG_LEVEL >= 2 ) \
        cout
 
@@ -203,5 +215,5 @@
 #if HARD_DEBUG_LEVEL >= 3
 #define COUT3 \
-     if (verbose >= 3 ) \
+     if (SOFT_DEBUG_LEVEL >= 3 ) \
        cout
 #else
@@ -211,5 +223,5 @@
 #if HARD_DEBUG_LEVEL >= 4
 #define COUT4 \
-     if (verbose >= 4 ) \
+     if (SOFT_DEBUG_LEVEL >= 4 ) \
        cout
 #else 
Index: orxonox/trunk/src/track_manager.cc
===================================================================
--- orxonox/trunk/src/track_manager.cc	(revision 3600)
+++ orxonox/trunk/src/track_manager.cc	(revision 3601)
@@ -732,8 +732,9 @@
 	      enumElem = tmpElem->children->nextElement();
 	    }
-	  
-	  
-	}
-    }
+	}
+    }
+  for (int i = 1; i <=trackElemCount;i++)
+    if (this->findTrackElementByID(i)->endTime > this->maxTime)
+      this->maxTime = findTrackElementByID(i)->endTime; // very bad implemented :/
 }
 
@@ -747,5 +748,4 @@
 Vector TrackManager::calcPos() const
 {
-  //  PRINTF(0)("TrackElement:%d, localTime: %f\n",this->currentTrackElem->ID, this->localTime);
   return this->currentTrackElem->curve->calcPos((this->localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration);
 }
@@ -780,5 +780,6 @@
   if (this->localTime <= this->firstTrackElem->duration)
     this->jumpTo(this->localTime);
-  this->localTime += dt;
+  if (this->localTime <= this->maxTime)
+    this->localTime += dt;
   if (this->localTime > this->currentTrackElem->endTime
       && this->currentTrackElem->children)
