Index: /branches/spaceshipcontrol/src/story_entities/world.cc
===================================================================
--- /branches/spaceshipcontrol/src/story_entities/world.cc	(revision 5891)
+++ /branches/spaceshipcontrol/src/story_entities/world.cc	(revision 5892)
@@ -119,5 +119,4 @@
   PRINTF(3)("World::~World() - deleting current world\n");
 
-  delete this->localPlayer;
 
   // here everything that is alocated by the World is deleted
@@ -125,4 +124,5 @@
   State::setWorldEntityList(NULL);
 
+  delete this->localPlayer;
 
   // delete all the initialized Engines.
@@ -140,4 +140,5 @@
   // erease everything that is left.
   delete NullParent::getInstance();
+
   Shader::suspendShader();
 
@@ -242,10 +243,10 @@
     }
 
-  TiXmlDocument* XMLDoc = new TiXmlDocument( path);
+  TiXmlDocument* XMLDoc = new TiXmlDocument( getPath());
   // load the campaign document
   if( !XMLDoc->LoadFile())
   {
     // report an error
-    PRINTF(1)("loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
+    PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getPath(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     delete XMLDoc;
     return (ErrorMessage){213,"XML File parsing error","World::load()"};
@@ -313,13 +314,21 @@
       while( element != NULL)
         {
-          WorldEntity* created = dynamic_cast<WorldEntity*>( loader->fabricate( element));
-          if( created != NULL) this->spawn( created);
+          BaseObject* created = (loader->fabricate(element));
+          if( created != NULL )
+          {
+            if(created->isA(CL_WORLD_ENTITY))
+              this->spawn(dynamic_cast<WorldEntity*>(created));
+            printf("Created a %s: %s\n", created->getClassName(), created->getName());
+          }
+
           // if we load a 'Player' we use it as localPlayer
 
+
           //todo do this more elegant
-          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created;
+          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
+            sky = dynamic_cast<SkyBox*>(created);
           if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
           {
-            terrain = (Terrain*) created;
+            terrain = dynamic_cast<Terrain*>(created);
             CDEngine::getInstance()->setTerrain(terrain);
           }
@@ -336,6 +345,6 @@
     LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
 
-//    LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
-//    LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
+//   LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
+//   LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
 
   // free the XML data
@@ -354,16 +363,14 @@
     playable = dynamic_cast<Playable*>(playableList->front());
     if (playable != NULL)
-      ;//this->localPlayer->setControllable(playable);
+      this->localPlayer->setControllable(playable);
   }
-  // bind input
-
 
   // bind camera
   playable->addChild (this->localCamera);
 
-
 //   //localCamera->setParent(TrackNode::getInstance());
 //  tn->addChild(this->localCamera);
-  localCamera->setClipRegion(1, 1000.0);
+  localCamera->setClipRegion(1, 10000.0);
+  localCamera->lookAt(playable);
 //  this->localPlayer->setParentMode(PNODE_ALL);
   if (sky != NULL)
@@ -386,4 +393,5 @@
   // STATIC //
   ////////////
+
 
 //   TestEntity* testEntity = new TestEntity();
@@ -486,5 +494,4 @@
 {
   this->bPause = false;
-  this->pilotNode = NULL;
 
   /* update the object position before game start - so there are no wrong coordinates used in the first processing */
Index: /branches/spaceshipcontrol/src/story_entities/world.h
===================================================================
--- /branches/spaceshipcontrol/src/story_entities/world.h	(revision 5891)
+++ /branches/spaceshipcontrol/src/story_entities/world.h	(revision 5892)
@@ -21,5 +21,4 @@
 class Text;
 class TiXmlElement;
-class PilotNode;
 
 class Shell;
@@ -120,7 +119,4 @@
     tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
     Player* localPlayer;                //!< The Player, you fly through the level.
-    PilotNode* pilotNode;               //!< THe pilot node to fly with the mouse
-
-
 };
 
