Index: /branches/single_player_map/src/lib/graphics/importer/bsp_file.cc
===================================================================
--- /branches/single_player_map/src/lib/graphics/importer/bsp_file.cc	(revision 8903)
+++ /branches/single_player_map/src/lib/graphics/importer/bsp_file.cc	(revision 8904)
@@ -46,4 +46,39 @@
 BspFile::BspFile()
 {}
+
+BspFile::~ BspFile()
+{
+  delete [] nodes;
+  delete [] leaves;
+  delete [] planes;
+  delete [] bspModels;
+  delete [] leafFaces;
+  delete [] faces;
+  delete [] leafBrushes;
+  delete [] brushes;
+  delete [] brushSides;
+  delete [] vertice;
+  delete [] meshverts;
+  delete [] visData;
+  delete [] textures;
+  delete [] patchVertice;
+  delete [] patchIndexes;
+ // delete [] patchTrianglesPerRow;
+  delete [] lightMaps;
+  
+  for(int i = 0; i < this->numPatches; ++i) delete this->VertexArrayModels[i];
+ // delete  [] VertexArrayModels;
+  
+  for(int i = 0; i < this->numTextures; ++i)
+  {
+    delete this->Materials[i].mat;
+    //delete this->Materials[i].aviMat;
+  }
+  delete [] this->Materials;
+  //delete [] testSurf;
+  
+  
+  
+}
 
 /**
@@ -294,5 +329,5 @@
     this->patchVertice = new char[8*8*44*(this->numPatches+10)];
     this->patchIndexes = new char[7*8*2*4*(this->numPatches+10)];
-    this->patchRowIndexes = new int*[7*4*this->numPatches];
+ // this->patchRowIndexes = new int*[7*4*this->numPatches]; Not needed?
     this->patchTrianglesPerRow = new char[7*4*this->numPatches];
     this->VertexArrayModels  = new VertexArrayModel*[this->numPatches];
@@ -464,5 +499,5 @@
 
     if(File(absFileName).exists()) {
-      PRINTF(0)("BSP FILE: gefunden . \n");
+      PRINTF(4)("BSP FILE: gefunden . \n");
       this->Materials[i] = this->loadAVI(fileName);
       continue;
@@ -553,5 +588,5 @@
     }
 
-    PRINTF(0)("BSP FILE: Textur %s nicht  gefunden . \n", &this->textures[8+72*i]);
+    PRINTF(0)("BSP FILE: Texture %s not found.",&this->textures[8+ 72*i] );
     //  Default Material
     this->Materials[i].mat = new Material();
@@ -1012,6 +1047,6 @@
   Face->meshvert = patchOffset -sz;  //3*(patchOffset-sz)*level1*level1;
   Face->n_meshverts = sz;
-  PRINTF(4)("BSP FILE: sz: %i. \n", sz);
-  PRINTF(4)("BSP FILE: Face->meshvert %i . \n", Face->meshvert);
+  PRINTF(0)("BSP FILE: sz: %i. \n", sz);
+  PRINTF(0)("BSP FILE: Face->meshvert %i . \n", Face->meshvert);
 
   //Face->n_meshverts = sz;
Index: /branches/single_player_map/src/lib/graphics/importer/bsp_file.h
===================================================================
--- /branches/single_player_map/src/lib/graphics/importer/bsp_file.h	(revision 8903)
+++ /branches/single_player_map/src/lib/graphics/importer/bsp_file.h	(revision 8904)
@@ -151,4 +151,5 @@
 public:
   BspFile();
+  ~BspFile();
   int read(const char* name );
   void build_tree();
@@ -183,5 +184,5 @@
 
   int** patchRowIndexes;
-  VertexArrayModel** VertexArrayModels;
+  VertexArrayModel** VertexArrayModels; 
   int patchOffset;
 
Index: /branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc
===================================================================
--- /branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc	(revision 8903)
+++ /branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc	(revision 8904)
@@ -77,10 +77,19 @@
 } */
 
-void BspManager::load(const char* fileName, float scale)
+BspManager::~BspManager()
+{
+  if(this->bspFile)
+    delete this->bspFile;
+}
+ 
+int BspManager::load(const char* fileName, float scale)
 {
   // open a BSP file
+  
+  
   this->bspFile = new BspFile();
   this->bspFile->scale =  scale;
-  this->bspFile->read(ResourceManager::getFullName(fileName).c_str());
+  if(this->bspFile->read(ResourceManager::getFullName(fileName).c_str()) == -1)
+    return -1;
   this->bspFile->build_tree();
   this->root  = this->bspFile->get_root();
@@ -88,4 +97,6 @@
 
   this->outputFraction = 1.0f;
+  
+  return 0;
 }
 /*
Index: /branches/single_player_map/src/lib/graphics/importer/bsp_manager.h
===================================================================
--- /branches/single_player_map/src/lib/graphics/importer/bsp_manager.h	(revision 8903)
+++ /branches/single_player_map/src/lib/graphics/importer/bsp_manager.h	(revision 8904)
@@ -41,4 +41,6 @@
 class WorldEntity;
 
+
+// Obsolete
 struct BspCollisionEvent
 {
@@ -54,7 +56,12 @@
 
   BspManager(const char* fileName, float scale = 0.4f);
-  void load(const char* fileName, float scale);
+  
+  // Deconstructor
+  ~BspManager();
+  
+ 
 
   // Functions
+  int load(const char* fileName, float scale);
   const void draw();
   const void tick(float time);
Index: /branches/single_player_map/src/world_entities/bsp_entity.cc
===================================================================
--- /branches/single_player_map/src/world_entities/bsp_entity.cc	(revision 8903)
+++ /branches/single_player_map/src/world_entities/bsp_entity.cc	(revision 8904)
@@ -1,12 +1,12 @@
 /*
    orxonox - the future of 3D-vertical-scrollers
-
+ 
    Copyright (C) 2004 orx
-
+ 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
-
+ 
    ### File Specific:
    main-programmer: Claudio Botta
@@ -15,4 +15,5 @@
 
 #include "bsp_entity.h"
+#include "util/loading/resource_manager.h"
 #include "util/loading/resource_manager.h"
 
@@ -43,4 +44,5 @@
 
 
+
 /**
  * initializes the BspEntity
@@ -50,8 +52,5 @@
 {
   this->setClassID(CL_BSP_ENTITY, "BspEntity");
-
-  this->bspManager = new BspManager(this);
-  this->toList(OM_ENVIRON);
-
+  this->bspManager = NULL;
   /**
    * @todo: Write CL_BSP_ENTITY INTO THE src/defs/class_id.h (your own definition)
@@ -64,5 +63,19 @@
   PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str());
 
-  this->bspManager->load(name.c_str(), 0.1f);
+  // Check wether file exists....
+  if ( File(ResourceManager::getFullName(name)).exists()  ){
+    // War das Laden erfolgreich?
+    this->bspManager = new BspManager(this);
+    if(this->bspManager->load(name.c_str(), 0.1f) == -1 ) {
+      this->bspManager = NULL;
+      // Dont do anything
+    } else {
+
+     
+      this->toList(OM_ENVIRON); // Success!!!
+    }
+  } else {
+    this->toList(OM_DEAD);
+  }
 }
 
@@ -76,12 +89,12 @@
 {
   // all the clases this Entity is directly derived from must be called in this way, to load all settings.
- // WorldEntity::loadParam(root);
+  // WorldEntity::loadParam(root);
 
   LoadParam(root, "Name", this, BspEntity, setName)
-      .describe("Sets the of the BSP file.");
+  .describe("Sets the of the BSP file.");
 
-/*  LoadParam(root, "Scale", this, BSpEntity, setScale)
-      .describe("Sets the scale factore of the bsp level.");
-*/
+  /*  LoadParam(root, "Scale", this, BSpEntity, setScale)
+        .describe("Sets the scale factore of the bsp level.");
+  */
 
   /**
@@ -115,5 +128,3 @@
  */
 void BspEntity::collidesWith (WorldEntity* entity, const Vector& location)
-{
-
-}
+{}
