Index: /orxonox/trunk/src/Makefile.in
===================================================================
--- /orxonox/trunk/src/Makefile.in	(revision 2639)
+++ /orxonox/trunk/src/Makefile.in	(revision 2640)
@@ -159,5 +159,5 @@
 HEADERS = $(noinst_HEADERS)
 
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in ChangeLog INSTALL \
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in INSTALL \
 	Makefile.am
 SOURCES = $(orxonox_SOURCES)
Index: /orxonox/trunk/src/player.cc
===================================================================
--- /orxonox/trunk/src/player.cc	(revision 2639)
+++ /orxonox/trunk/src/player.cc	(revision 2640)
@@ -71,5 +71,5 @@
 
 void Player::draw ()
-{
+{ 
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
Index: /orxonox/trunk/src/world.cc
===================================================================
--- /orxonox/trunk/src/world.cc	(revision 2639)
+++ /orxonox/trunk/src/world.cc	(revision 2640)
@@ -50,5 +50,6 @@
 World::~World ()
 {
-  unload ();
+  Orxonox *orx = Orxonox::getInstance();
+  orx->get_localinput()->unbind (localPlayer);
   delete entities;
 }
@@ -72,4 +73,5 @@
   this->bQuitCurrentGame = true;
   this->localCamera->setWorld(NULL);
+  this->~World();
 }
 
@@ -111,5 +113,6 @@
 	    // create a player
 	    WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
-	    
+	    this->localPlayer = myPlayer;	    
+
 	    // bind input
 	    Orxonox *orx = Orxonox::getInstance();
@@ -142,4 +145,5 @@
 	    // create a player
 	    WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
+	    this->localPlayer = myPlayer;
 	    
 	    // bind input
@@ -394,4 +398,19 @@
 }
 
+void World::debug()
+{
+  List<WorldEntity> *l;
+  WorldEntity* entity;
+  
+  printf("counting all entities\n");
+  l = entities->get_next();  
+  while( l != NULL ) 
+    { 
+      entity = l->get_object();
+      if( entity->bDraw ) printf("got an entity\n");
+      l = l->get_next();
+    }
+}
+
 
 void World::mainLoop()
@@ -403,4 +422,6 @@
   while(!this->bQuitOrxonox && !this->bQuitCurrentGame) /* pause pause pause ?!?!?*/
     {
+      //debug routine
+      //debug();
       // Network
       synchronize();
Index: /orxonox/trunk/src/world.h
===================================================================
--- /orxonox/trunk/src/world.h	(revision 2639)
+++ /orxonox/trunk/src/world.h	(revision 2640)
@@ -68,4 +68,6 @@
   int debugWorldNr;
 
+  WorldEntity* localPlayer;
+  
   void mainLoop();
   void synchronize();
@@ -74,4 +76,5 @@
   void collision();
   void display();
+  void debug();
 };
 
@@ -89,22 +92,22 @@
 template<typename T> T* World::spawn(Location* loc = NULL, WorldEntity* owner = NULL)
 {
-	Location zeroloc;
-	T* entity = new T();
-	entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
-	if( loc == NULL)
-	{
-	  zeroloc.dist = 0;
-	  zeroloc.part = 0;
-		zeroloc.pos = Vector();
-		zeroloc.rot = Quaternion();
-		loc = &zeroloc;
-	}
-	entity->init (loc, owner);
-	if (entity->bFree)
-	{
-		track[loc->part].map_coords( loc, entity->get_placement());
-	}
-	entity->post_spawn ();
-	return entity;
+  Location zeroloc;
+  T* entity = new T();
+  entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
+  if( loc == NULL)
+    {
+      zeroloc.dist = 0;
+      zeroloc.part = 0;
+      zeroloc.pos = Vector();
+      zeroloc.rot = Quaternion();
+      loc = &zeroloc;
+    }
+  entity->init (loc, owner);
+  if (entity->bFree)
+    {
+      track[loc->part].map_coords( loc, entity->get_placement());
+    }
+  entity->post_spawn ();
+  return entity;
 }
 
@@ -123,15 +126,15 @@
 template<typename T> T* World::spawn(Placement* plc, WorldEntity* owner = NULL)
 {
-	T* entity = new T();
-	entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
-	entity->init (plc, owner);
-	if (!entity->bFree)
-	{
-		printf("Can't spawn unfree entity with placement\n"); 
-		entities->remove( (WorldEntity*)entity, LIST_FIND_FW);
-		return NULL;
-	}
-	entity->post_spawn ();
-	return entity;
+  T* entity = new T();
+  entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
+  entity->init (plc, owner);
+  if (!entity->bFree)
+    {
+      printf("Can't spawn unfree entity with placement\n"); 
+      entities->remove( (WorldEntity*)entity, LIST_FIND_FW);
+      return NULL;
+    }
+  entity->post_spawn ();
+  return entity;
 }
 
