Index: trunk/src/lib/collision_detection/obb_tree.cc
===================================================================
--- trunk/src/lib/collision_detection/obb_tree.cc	(revision 9112)
+++ trunk/src/lib/collision_detection/obb_tree.cc	(revision 9235)
@@ -41,4 +41,11 @@
 
 
+/**
+ *  standard constructor
+ */
+OBBTree::OBBTree()
+  : BVTree()
+{}
+
 
 void OBBTree::init()
@@ -78,4 +85,12 @@
 
   this->rootNode->spawnBVTree(modelInf, triangleIndexes, modelInf.numTriangles);
+}
+
+
+void OBBTree::createBox(Vector start, Vector end)
+{
+  this->rootNode = new OBBTreeNode(*this, NULL, 1);
+
+  this->rootNode->createBox(start, end);
 }
 
Index: trunk/src/lib/collision_detection/obb_tree.h
===================================================================
--- trunk/src/lib/collision_detection/obb_tree.h	(revision 9112)
+++ trunk/src/lib/collision_detection/obb_tree.h	(revision 9235)
@@ -23,4 +23,5 @@
   public:
     OBBTree(int depth, const modelInfo* modInfo, WorldEntity* entity);
+    OBBTree();
     virtual ~OBBTree();
     void init();
@@ -28,4 +29,6 @@
     virtual void spawnBVTree(const modelInfo& modelInf);
     virtual void flushTree();
+
+    void createBox(Vector start, Vector end);
 
     virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2);
Index: trunk/src/lib/collision_detection/obb_tree_node.cc
===================================================================
--- trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 9112)
+++ trunk/src/lib/collision_detection/obb_tree_node.cc	(revision 9235)
@@ -90,4 +90,25 @@
     delete this->bvElement;
 }
+
+
+
+void OBBTreeNode::createBox(Vector start, Vector end)
+{
+
+  this->bvElement = new OBB();
+  this->nodeLeft = NULL;
+  this->nodeRight = NULL;
+//   this->depth = 0;
+
+  this->bvElement->center = (end - start) * 0.5f;
+  this->bvElement->halfLength[0] = (end.x - start.x) * 0.5f;
+  this->bvElement->halfLength[1] = (end.y - start.y) * 0.5f;
+  this->bvElement->halfLength[2] = (end.z - start.z) * 0.5f;
+
+  this->bvElement->axis[0] = Vector(1,0,0);
+  this->bvElement->axis[1] = Vector(0,1,0);
+  this->bvElement->axis[2] = Vector(0,0,1);
+}
+
 
 
@@ -561,4 +582,5 @@
 bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB)
 {
+
   //HACK remove this again
   this->owner = nodeA;
@@ -677,4 +699,5 @@
 void OBBTreeNode::drawBV(int depth, int drawMode, const Vector& color,  bool top) const
 {
+
   /* this function can be used to draw the triangles and/or the points only  */
   if( 1 /*drawMode & DRAW_MODEL || drawMode & DRAW_ALL*/)
@@ -682,5 +705,5 @@
     if( depth == 0/*!(drawMode & DRAW_SINGLE && depth != 0)*/)
     {
-      if( 1 /*drawMode & DRAW_POINTS*/)
+      if( 0 /*drawMode & DRAW_POINTS*/)
       {
         glBegin(GL_POINTS);
Index: trunk/src/lib/collision_detection/obb_tree_node.h
===================================================================
--- trunk/src/lib/collision_detection/obb_tree_node.h	(revision 9112)
+++ trunk/src/lib/collision_detection/obb_tree_node.h	(revision 9235)
@@ -31,4 +31,5 @@
 
     virtual void spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, int length);
+    void createBox(Vector start, Vector end);
 
     virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB);
@@ -79,4 +80,5 @@
 
     WorldEntity*        owner;
+
 };
 
Index: trunk/src/lib/collision_reaction/Makefile.am
===================================================================
--- trunk/src/lib/collision_reaction/Makefile.am	(revision 9112)
+++ trunk/src/lib/collision_reaction/Makefile.am	(revision 9235)
@@ -10,5 +10,6 @@
                      collision_reaction.cc \
                      cr_object_damage.cc \
-                     cr_physics_ground_walk.cc
+                     cr_physics_ground_walk.cc \
+                     cr_physics_full_walk.cc
 
 
@@ -21,4 +22,5 @@
                      collision_reaction.h \
                      cr_object_damage.h \
-                     cr_physics_ground_walk.h
+                     cr_physics_ground_walk.h \
+                     cr_physics_full_walk.h
 
Index: trunk/src/lib/collision_reaction/collision_handle.cc
===================================================================
--- trunk/src/lib/collision_reaction/collision_handle.cc	(revision 9112)
+++ trunk/src/lib/collision_reaction/collision_handle.cc	(revision 9235)
@@ -25,4 +25,5 @@
 #include "cr_object_damage.h"
 #include "cr_physics_ground_walk.h"
+#include "cr_physics_full_walk.h"
 
 #include "debug.h"
@@ -52,6 +53,6 @@
   switch( type)
   {
-    case CREngine::CR_PHYSICS_STEP_BACK:
-//       this->collisionReaction = new CRPhysicsGroundWalk();
+    case CREngine::CR_PHYSICS_FULL_WALK:
+      this->collisionReaction = new CRPhysicsFullWalk();
       this->bContinuousPoll = true;
       break;
@@ -229,4 +230,26 @@
   for(; it < this->targetList.end(); it++)
   {
+//     if(collisionEvent->getEntityB()->isA(CL_AIMING_SYSTEM) || collisionEvent->getEntityA()->isA(CL_AIMING_SYSTEM))
+//     {
+//        PRINTF(0)("I am: %s colliding with: %s\n", owner->getClassName(), collisionEvent->getEntityB()->getClassName(), *it);
+//        if( collisionEvent->getEntityA() == this->owner) {
+//          PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassName(),
+//          collisionEvent->getEntityB()->getClassName(), *it);
+//          if( collisionEvent->getEntityB()->isA((ClassID)(*it))) {
+//            PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassName(),
+//            collisionEvent->getEntityB()->getClassName(), *it);
+//             }
+//        }
+//        else {
+//          PRINTF(0)("I am not owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassName(),
+//          collisionEvent->getEntityB()->getClassName(), *it);
+//          if( collisionEvent->getEntityA()->isA((ClassID)(*it))) {
+//            PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassName(),
+//            collisionEvent->getEntityA()->getClassName(), *it);
+//             }
+//        }
+//
+//     }
+
     if( collisionEvent->getEntityA() == this->owner) {
       if( collisionEvent->getEntityB()->isA((ClassID)(*it))) {
@@ -256,4 +279,26 @@
   for(; it < this->targetList.end(); it++)
   {
+
+//     if(collision->getEntityB()->isA(CL_AIMING_SYSTEM) || collision->getEntityA()->isA(CL_AIMING_SYSTEM))
+//     {
+//       PRINTF(0)("Shared!!! I am: %s colliding with: %s\n", owner->getClassName(), collision->getEntityB()->getClassName(), *it);
+//       if( collision->getEntityA() == this->owner) {
+//         PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassName(),
+//         collision->getEntityB()->getClassName(), *it);
+//         if( collision->getEntityB()->isA((ClassID)(*it))) {
+//           PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassName(),
+//           collision->getEntityB()->getClassName(), *it);
+//         }
+//       }
+//       else {
+//         PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassName(),
+//         collision->getEntityB()->getClassName(), *it);
+//         if( collision->getEntityA()->isA((ClassID)(*it))) {
+//           PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassName(),
+//           collision->getEntityA()->getClassName(), *it);
+//         }
+//       }
+//     }
+
     if( collision->getEntityA() == this->owner) {
       if( collision->getEntityA()->isA((ClassID)(*it)))
Index: trunk/src/lib/collision_reaction/cr_engine.h
===================================================================
--- trunk/src/lib/collision_reaction/cr_engine.h	(revision 9112)
+++ trunk/src/lib/collision_reaction/cr_engine.h	(revision 9235)
@@ -30,6 +30,6 @@
     CR_PHYSICS_MOMENTUM   = 0,    //!< physical reaction: conservervation of momentum
     CR_PHYSICS_STEP_BACK,         //!< physical reaction: just go to the last position without collisions
-    CR_PHYSICS_GROUND,            //!< physical reaction: stand on the ground, no movement: simulating simple normal force away from the gravity force
-    CR_PHYSICS_GROUND_WALK,       //!< physical reaction: walking on the ground (inkl. hills etc)
+    CR_PHYSICS_GROUND_WALK,       //!< physical reaction: stand on the ground, no movement: simulating simple normal force away from the gravity force
+    CR_PHYSICS_FULL_WALK,         //!< physical reaction: walking on the ground (inkl. hills etc)
     CR_PHYSICS_DAMAGE,            //!< physical reaction: daling damage according to the object energy and their structural stability
 
Index: trunk/src/lib/collision_reaction/cr_object_damage.cc
===================================================================
--- trunk/src/lib/collision_reaction/cr_object_damage.cc	(revision 9112)
+++ trunk/src/lib/collision_reaction/cr_object_damage.cc	(revision 9235)
@@ -56,5 +56,5 @@
   float damage = 0.0f;
 
-  PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",
+  PRINTF(4)("Dealing damage - Handling collision: %s vs %s\n",
             collision->getEntityA()->getClassName(),
             collision->getEntityB()->getClassName());
Index: trunk/src/lib/collision_reaction/cr_physics_full_walk.cc
===================================================================
--- trunk/src/lib/collision_reaction/cr_physics_full_walk.cc	(revision 9235)
+++ trunk/src/lib/collision_reaction/cr_physics_full_walk.cc	(revision 9235)
@@ -0,0 +1,228 @@
+/*
+   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: Patrick Boenzli
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_REACTION
+
+#include "collision.h"
+#include "collision_event.h"
+
+#include "physics_interface.h"
+
+#include "world_entity.h"
+#include "cr_physics_full_walk.h"
+#include "collision_reaction.h"
+
+#include <vector>
+
+#include "debug.h"
+
+#include "aabb.h"
+
+#include "cr_defs.h"
+
+using namespace std;
+
+
+/**
+ *  standard constructor
+ */
+CRPhysicsFullWalk::CRPhysicsFullWalk ()
+    : CollisionReaction()
+{
+  this->setClassID(CL_CR_PHYSICS_FULL_WALK, "CRPhysicsFullWalk");
+}
+
+
+/**
+ *  standard deconstructor
+ */
+CRPhysicsFullWalk::~CRPhysicsFullWalk ()
+{}
+
+
+/**
+ * caluculates and applys the reaction to a specific collision
+ *  @param collision the collision
+ */
+void CRPhysicsFullWalk::reactToCollision(Collision* collision)
+{
+
+  AABB* box = collision->getEntityB()->getModelAABB();
+  WorldEntity* entity = collision->getEntityB();
+
+  if( box == NULL)
+  {
+    PRINTF(2)("this model has no aabb box so there is no correct collision reaction implemented. skipping\n");
+    return;
+  }
+
+
+  float CR_MAX_WALK_HEIGHT = 15.0f;
+  float CR_THRESHOLD = 0.2f;
+
+  float height = 0.0f;
+  float front = 0.0f;
+  float back = 0.0f;
+  float right = 0.0f;
+  float left = 0.0f;
+
+
+  const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents());
+  std::vector<CollisionEvent*>::const_iterator it = collisionEvents->begin();
+  for(; it != collisionEvents->end(); it++)
+  {
+
+    CollisionEvent* ce = (*it);
+    Vector normal = ce->getGroundNormal();
+
+    // calculate the collision position
+    Vector collPos =  collision->getEntityB()->getAbsCoor()  + box->center - ce->getCollisionPosition();
+
+    // test the 3 axis differently
+    switch( ce->getType())
+    {
+        /* collision in the X-AXIS */
+      case COLLISION_TYPE_AXIS_X:
+        front = collPos.len() - box->halfLength[0];
+
+        // object is beneath the plane (ground)
+        if( front <= 0.0f )
+        {
+          Vector dirX = entity->getAbsDirX();
+          dirX.y = 0.0f;
+          dirX.normalize();
+          Vector backoff = dirX * front;
+
+          entity->shiftCoor(backoff);
+        }
+        else if( ce->isInWall())
+        {
+          // object is already in the wall
+          entity->setAbsCoor(entity->getLastAbsCoor());
+        }
+        break;
+
+      case COLLISION_TYPE_AXIS_X_NEG:
+        back = collPos.len() - box->halfLength[0];
+
+        // object is beneath the plane (ground)
+        if( back <= 0.0f)
+        {
+          Vector dirX = entity->getAbsDirX();
+          dirX.y = 0.0f;
+          dirX.normalize();
+          Vector backoff = dirX * back * -1.0f;
+
+          entity->shiftCoor(backoff);
+        }
+        else if( ce->isInWall())
+        {
+          // object is already in the wall
+          entity->setAbsCoor(entity->getLastAbsCoor());
+        }
+        break;
+
+
+        /* collision in the Y-AXIS */
+      case COLLISION_TYPE_AXIS_Y_NEG:
+        // calulate the height above ground
+        height = collPos.len() - box->halfLength[1];
+
+
+        // object is beneath the plane (ground)
+        //         if(height >= 0.0f && height <= 0.0001f) break ;// Do nothing
+        if( height < 0.0f && -height < CR_MAX_WALK_HEIGHT)
+        {
+          entity->shiftCoor(Vector(0.0f, -height + 0.00001, 0.0f));
+          entity->setOnGround(true);
+        }
+        // object is already in the wall
+        else if( ce->isInWall())
+        {
+          entity->setAbsCoor(entity->getLastAbsCoor());
+          PRINTF(0)("ground collision: reset pos\n");
+        }
+        else
+        {
+          // entity is not on ground
+          entity->setOnGround(false);
+        }
+        break;
+
+
+        /* collision in the Z-AXIS */
+      case COLLISION_TYPE_AXIS_Z:
+
+        right = collPos.len()  - box->halfLength[2];
+
+        // object is beneath the plane (ground)
+        if( right <= 0.0f )
+        {
+          Vector dirZ = entity->getAbsDirZ();
+          dirZ.y = 0.0f;
+          dirZ.normalize();
+          Vector backoff = dirZ * right;
+          entity->shiftCoor(backoff);
+        }
+        else if( ce->isInWall())
+        {
+          // object is already in the wall
+          entity->setAbsCoor(entity->getLastAbsCoor());
+        }
+        break;
+
+
+        // collision in the z-axis
+      case COLLISION_TYPE_AXIS_Z_NEG:
+
+        left = collPos.len()  - box->halfLength[2];
+
+        // object is beneath the plane (ground)
+        if( left <= 0.0f )
+        {
+          Vector dirZ = entity->getAbsDirZ();
+          dirZ.y = 0.0f;
+          dirZ.normalize();
+          Vector backoff = dirZ * left*-1.0f;
+          entity->shiftCoor(backoff);
+        }
+        // object is already in the wall
+        else if( ce->isInWall())
+        {
+          entity->setAbsCoor(entity->getLastAbsCoor());
+        }
+        break;
+    }
+  }
+  //PRINTF(0)("collision distances: x: %f, y: %f, z: %f\n", front, height, side);
+
+
+
+
+
+
+
+}
+
+
+
+
+/**
+ * use this to do some collision offline calculations, only called for bContinuousPoll == true
+ */
+void CRPhysicsFullWalk::update(WorldEntity* owner)
+{}
+
+
Index: trunk/src/lib/collision_reaction/cr_physics_full_walk.h
===================================================================
--- trunk/src/lib/collision_reaction/cr_physics_full_walk.h	(revision 9235)
+++ trunk/src/lib/collision_reaction/cr_physics_full_walk.h	(revision 9235)
@@ -0,0 +1,30 @@
+/*!
+ * @file cr_object_damage.h
+ *  Definition of a collision reaction: dealing damage to an object
+ */
+
+#ifndef _CR_PHYSICS_FULL_WALK_H
+#define _CR_PHYSICS_FULL_WALK_H
+
+#include "collision_reaction.h"
+
+
+class Collision;
+
+//! A class representing a reaction to a collision: dealing damage to an object
+class CRPhysicsFullWalk : public CollisionReaction
+{
+  public:
+    CRPhysicsFullWalk();
+    virtual ~CRPhysicsFullWalk();
+
+    virtual void reactToCollision(Collision* collision);
+
+    virtual void update(WorldEntity* entity);
+
+
+  private:
+    float        downspeed;
+};
+
+#endif /* _CR_PHYSICS_FULL_WALK_H */
Index: trunk/src/lib/collision_reaction/cr_physics_ground_walk.cc
===================================================================
--- trunk/src/lib/collision_reaction/cr_physics_ground_walk.cc	(revision 9112)
+++ trunk/src/lib/collision_reaction/cr_physics_ground_walk.cc	(revision 9235)
@@ -71,11 +71,6 @@
 
   float CR_MAX_WALK_HEIGHT = 15.0f;
-  float CR_THRESHOLD = 0.2f;
 
   float height = 0.0f;
-  float front = 0.0f;
-  float back = 0.0f;
-  float right = 0.0f;
-  float left = 0.0f;
 
 
@@ -94,46 +89,4 @@
     switch( ce->getType())
     {
-        /* collision in the X-AXIS */
-      case COLLISION_TYPE_AXIS_X:
-        front = collPos.len() - box->halfLength[0];
-
-        // object is beneath the plane (ground)
-        if( front <= 0.0f )
-        {
-          Vector dirX = entity->getAbsDirX();
-          dirX.y = 0.0f;
-          dirX.normalize();
-          Vector backoff = dirX * front;
-
-          entity->shiftCoor(backoff);
-        }
-        else if( ce->isInWall())
-        {
-          // object is already in the wall
-          entity->setAbsCoor(entity->getLastAbsCoor());
-        }
-        break;
-
-      case COLLISION_TYPE_AXIS_X_NEG:
-        back = collPos.len() - box->halfLength[0];
-
-        // object is beneath the plane (ground)
-        if( back <= 0.0f)
-        {
-          Vector dirX = entity->getAbsDirX();
-          dirX.y = 0.0f;
-          dirX.normalize();
-          Vector backoff = dirX * back * -1.0f;
-
-          entity->shiftCoor(backoff);
-        }
-        else if( ce->isInWall())
-        {
-          // object is already in the wall
-          entity->setAbsCoor(entity->getLastAbsCoor());
-        }
-        break;
-
-
         /* collision in the Y-AXIS */
       case COLLISION_TYPE_AXIS_Y_NEG:
@@ -153,5 +106,4 @@
         {
           entity->setAbsCoor(entity->getLastAbsCoor());
-          PRINTF(0)("ground collision: reset pos\n");
         }
         else
@@ -163,55 +115,7 @@
 
 
-        /* collision in the Z-AXIS */
-      case COLLISION_TYPE_AXIS_Z:
-
-        right = collPos.len()  - box->halfLength[2];
-
-        // object is beneath the plane (ground)
-        if( right <= 0.0f )
-        {
-          Vector dirZ = entity->getAbsDirZ();
-          dirZ.y = 0.0f;
-          dirZ.normalize();
-          Vector backoff = dirZ * right;
-          entity->shiftCoor(backoff);
-        }
-        else if( ce->isInWall())
-        {
-          // object is already in the wall
-          entity->setAbsCoor(entity->getLastAbsCoor());
-        }
-        break;
-
-
-        // collision in the z-axis
-      case COLLISION_TYPE_AXIS_Z_NEG:
-
-        left = collPos.len()  - box->halfLength[2];
-
-        // object is beneath the plane (ground)
-        if( left <= 0.0f )
-        {
-          Vector dirZ = entity->getAbsDirZ();
-          dirZ.y = 0.0f;
-          dirZ.normalize();
-          Vector backoff = dirZ * left*-1.0f;
-          entity->shiftCoor(backoff);
-        }
-        // object is already in the wall
-        else if( ce->isInWall())
-        {
-          entity->setAbsCoor(entity->getLastAbsCoor());
-        }
-        break;
     }
   }
   //PRINTF(0)("collision distances: x: %f, y: %f, z: %f\n", front, height, side);
-
-
-
-
-
-
 
 }
Index: trunk/src/lib/coord/p_node.cc
===================================================================
--- trunk/src/lib/coord/p_node.cc	(revision 9112)
+++ trunk/src/lib/coord/p_node.cc	(revision 9235)
@@ -1089,4 +1089,6 @@
 void PNode::varChangeHandler( std::list< int > & id )
 {
+  Synchronizeable::varChangeHandler( id );
+  
   if ( std::find( id.begin(), id.end(), relCoordinate_handle ) != id.end() )
   {
Index: trunk/src/lib/graphics/effects/cloud_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/cloud_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/cloud_effect.cc	(revision 9235)
@@ -90,4 +90,5 @@
     this->planetRadius = 1500;
     this->divs = 15;
+    this->cloudActivate = false;
     fadeSky = false;
     fadeCloud = false;
Index: trunk/src/lib/graphics/effects/fog_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/fog_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/fog_effect.cc	(revision 9235)
@@ -20,8 +20,9 @@
 #include "shell_command.h"
 #include "script_class.h"
+#include "cloud_effect.h"
 
 // Define shell commands
-SHELL_COMMAND(activate, FogEffect, activateFog);
-SHELL_COMMAND(deactivate, FogEffect, deactivateFog);
+//SHELL_COMMAND(activate, FogEffect, activateFog);
+//SHELL_COMMAND(deactivate, FogEffect, deactivateFog);
 SHELL_COMMAND(fadein, FogEffect, fadeInFog);
 SHELL_COMMAND(fadeout, FogEffect, fadeOutFog);
@@ -84,4 +85,7 @@
   this->fogFadeInActivate = false;
   this->fogFadeOutActivate = false;
+  
+  this->cloudColor = Vector(0.2f, 0.3f, 0.3f);
+  this->skyColor = Vector(0.2f, 0.3f, 0.3f);
 }
 
@@ -93,14 +97,16 @@
     WeatherEffect::loadParams(root);
 
-    LoadParam(root, "mode", this, FogEffect, setFogMode).describe("fog mode (linear, exponential)");;
-    LoadParam(root, "density", this, FogEffect, setFogDensity).describe("fog density if exp. fog");;
-    LoadParam(root, "range", this, FogEffect, setFogRange).describe("fog range: start, end");;
-    LoadParam(root, "color", this, FogEffect, setFogColor).describe("fog color: r,g,b");;
-    LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn).describe("duration of the fade in");;
-    LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut).describe("duration of the fade out");;
-
+    LoadParam(root, "mode", this, FogEffect, setFogMode).describe("fog mode (linear, exponential)");
+    LoadParam(root, "density", this, FogEffect, setFogDensity).describe("fog density if exp. fog");
+    LoadParam(root, "range", this, FogEffect, setFogRange).describe("fog range: start, end");
+    LoadParam(root, "color", this, FogEffect, setFogColor).describe("fog color: r,g,b");
+    LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn).describe("duration of the fade in");
+    LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut).describe("duration of the fade out");
+    LoadParam(root, "cloudcolor", this, FogEffect, setCloudColor);
+    LoadParam(root, "skycolor", this, FogEffect, setSkyColor);
+    
     LOAD_PARAM_START_CYCLE(root, element);
     {
-      LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption).describe("sets a fog option: activate");;
+      LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption).describe("sets a fog option: activate");
     }
     LOAD_PARAM_END_CYCLE(element);
@@ -125,4 +131,12 @@
 
     glEnable(GL_FOG);
+    
+    // Store cloud- and sky color before the snow
+    this->oldCloudColor = CloudEffect::cloudColor;
+    this->oldSkyColor   = CloudEffect::skyColor;
+    
+    // Change the colors
+    CloudEffect::changeCloudColor(this->cloudColor, this->fogFadeInDuration);
+    CloudEffect::changeSkyColor(this->skyColor, this->fogFadeInDuration);
 }
 
@@ -184,7 +198,7 @@
 
         if ( this->fogMode == GL_LINEAR)
-          this->fogFadeEnd = 2000 * ( this->localTimer / this->fogFadeInDuration ) + this->fogEnd;
+          this->fogFadeEnd = 2000 * ( this->localTimer / this->fogFadeOutDuration ) + this->fogEnd;
         else
-            this->fogFadeDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity);
+            this->fogFadeDensity = 1 - (( this->localTimer / this->fogFadeOutDuration ) * this->fogDensity);
 
         if ( this->localTimer >= this->fogFadeOutDuration )
@@ -207,5 +221,5 @@
     // If no manual FadeIn value was set, set a default value
     if (!this->fogFadeInDuration > 0)
-        this->fogFadeInDuration = 20;
+        this->fogFadeInDuration = 10;
 
     // Reset local timer
@@ -227,4 +241,5 @@
     this->fogFadeInActivate = false;
 
+    
     // If Fog is off, turn it on first
     if (!this->fogActivate)
@@ -233,5 +248,5 @@
     // If no manual FadeOut value was set, set a default value
     if (!this->fogFadeOutDuration > 0)
-        this->fogFadeOutDuration = 20;
+        this->fogFadeOutDuration = 10;
 
     // set FogFadeOut activate
@@ -240,4 +255,8 @@
     // Reset local timer
     this->localTimer = 0;
-}
-
+
+    // Restore the old cloud- and sky color
+    CloudEffect::changeCloudColor(this->oldCloudColor, this->fogFadeOutDuration);
+    CloudEffect::changeSkyColor(this->oldSkyColor, this->fogFadeOutDuration);
+}
+
Index: trunk/src/lib/graphics/effects/fog_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/fog_effect.h	(revision 9112)
+++ trunk/src/lib/graphics/effects/fog_effect.h	(revision 9235)
@@ -10,4 +10,6 @@
 #include "glincl.h"
 #include "vector.h"
+
+class CloudEffect;
 
 class FogEffect : public WeatherEffect
@@ -73,4 +75,13 @@
       this->fogActivate = true;
   }
+  
+  inline void setCloudColor(float colorX, float colorY, float colorZ)
+  {
+    this->cloudColor = Vector(colorX, colorY, colorZ);
+  }
+  inline void setSkyColor(float colorX, float colorY, float colorZ)
+  {
+    this->skyColor = Vector(colorX, colorY, colorZ);
+  }
 
   void fadeInFog();
@@ -109,4 +120,9 @@
   Vector        colorVector;
   float         localTimer; 
+  
+  Vector oldSkyColor;
+  Vector oldCloudColor;
+  Vector skyColor;
+  Vector cloudColor;
 };
 
Index: trunk/src/lib/graphics/effects/lightning_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/lightning_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/lightning_effect.cc	(revision 9235)
@@ -112,6 +112,8 @@
     }
 
+    //should load both texture
     this->thunderTextureA = true;
     this->setTexture();
+    this->switchTexture();
 
     if (this->lightningMove) {
Index: trunk/src/lib/graphics/effects/rain_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/rain_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/rain_effect.cc	(revision 9235)
@@ -34,6 +34,6 @@
 
 // Define shell commands
-SHELL_COMMAND(activate, RainEffect, activateRain);
-SHELL_COMMAND(deactivate, RainEffect, deactivateRain);
+//SHELL_COMMAND(activate, RainEffect, activateRain);
+//SHELL_COMMAND(deactivate, RainEffect, deactivateRain);
 SHELL_COMMAND(startraining, RainEffect, startRaining);
 SHELL_COMMAND(stopraining, RainEffect, stopRaining);
@@ -96,4 +96,11 @@
  */
 void RainEffect::init() {
+
+    this->rainParticles = NULL;
+    this->emitter = NULL;
+    this->rainBuffer = NULL;
+    this->windBuffer = NULL;
+    this->lightMan = NULL;
+
     //Default values
     this->rainActivate = false;
@@ -119,4 +126,5 @@
     this->emitter = new PlaneEmitter(this->rainSize);
 
+    lightMan = LightManager::getInstance();
 }
 
@@ -187,7 +195,9 @@
     // If we're not fading, change color immediately
     if (!this->rainFadeInActivate || !this->rainFadeOutActivate) {
-        CloudEffect::changeCloudColor(this->cloudColor, 0);
-        CloudEffect::changeSkyColor(this->skyColor, 0);
-    }
+        CloudEffect::changeCloudColor(this->cloudColor, 0.2);
+        CloudEffect::changeSkyColor(this->skyColor, 0.2);
+    }
+
+    //lightMan->setAmbientColor(.1,.1,.1);
 }
 
@@ -202,5 +212,7 @@
     this->rainFadeOutActivate = false;
 
-    this->emitter->setSystem(NULL);
+    //if(this->emitter)
+    //  this->emitter->setSystem(NULL);
+    //this->hideRain();
 
     // Stop Sound
@@ -208,6 +220,6 @@
 
     // Restore the old cloud- and sky color
-    CloudEffect::changeCloudColor(this->oldCloudColor, 0);
-    CloudEffect::changeSkyColor(this->oldSkyColor, 0);
+    CloudEffect::changeCloudColor(this->oldCloudColor, 0.2);
+    CloudEffect::changeSkyColor(this->oldSkyColor, 0.2);
 }
 
@@ -242,10 +254,14 @@
 
         // increase sound volume
-        if (!this->soundSource.isPlaying())
+        if (progress > 0.5) {
+          if (!this->soundSource.isPlaying())
             this->soundSource.play(this->rainBuffer, this->soundRainVolume, true);
-        this->soundSource.gain(this->rainBuffer, this->soundRainVolume * progress);
+          this->soundSource.gain(this->rainBuffer, this->soundRainVolume * progress * 2 - 0.5);
+        }
 
         if (progress >= 1)
             this->rainFadeInActivate = false;
+
+        lightMan->setAmbientColor(1-progress, 1-progress, 1-progress);
     }
 
@@ -276,4 +292,5 @@
             this->deactivate();
         }
+        lightMan->setAmbientColor(1-progress, 1-progress, 1-progress);
     }
 }
Index: trunk/src/lib/graphics/effects/rain_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/rain_effect.h	(revision 9112)
+++ trunk/src/lib/graphics/effects/rain_effect.h	(revision 9235)
@@ -132,8 +132,10 @@
   float                       soundRainVolume;
 
-  Vector oldSkyColor;
-  Vector oldCloudColor;
-  Vector skyColor;
-  Vector cloudColor;
+  Vector                      oldSkyColor;
+  Vector                      oldCloudColor;
+  Vector                      skyColor;
+  Vector                      cloudColor;
+  
+  LightManager*               lightMan;
 
 };
Index: trunk/src/lib/graphics/effects/snow_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/snow_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/snow_effect.cc	(revision 9235)
@@ -28,4 +28,5 @@
 #include "shell_command.h"
 #include "script_class.h"
+#include "cloud_effect.h"
 
 #include "parser/tinyxml/tinyxml.h"
@@ -53,8 +54,8 @@
 
 	//load wind sound
-	if (this->snowWindForce > 1) {
+	if (this->snowWindForce >= 1) {
 		if (this->windBuffer != NULL)
 			ResourceManager::getInstance()->unload(this->windBuffer);
-	       		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
+	  this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
 	}
 
@@ -87,4 +88,7 @@
 	LoadParam(root, "size", this, SnowEffect, size);
 	LoadParam(root, "coord", this, SnowEffect, coord);
+  LoadParam(root, "cloudcolor", this, SnowEffect, setCloudColor);
+  LoadParam(root, "skycolor", this, SnowEffect, setSkyColor);
+  LoadParam(root, "fadetime", this, SnowEffect, setFadeTime);
 
 	LOAD_PARAM_START_CYCLE(root, element);
@@ -119,4 +123,8 @@
 	this->snowCoord = Vector(100,450,400);
 	this->snowWindForce = 1;
+  
+  this->fadeTime = 10;
+  this->cloudColor = Vector(0.2f, 0.2f, 0.2f);
+  this->skyColor = Vector(0.0f, 0.0f, 0.0f);
 }
 
@@ -149,4 +157,12 @@
   if (this->snowWindForce != 0)
     this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true);
+  
+  // Store cloud- and sky color before the snow
+  this->oldCloudColor = CloudEffect::cloudColor;
+  this->oldSkyColor   = CloudEffect::skyColor;
+
+  // Change the colors
+  CloudEffect::changeCloudColor(this->cloudColor, this->fadeTime);
+  CloudEffect::changeSkyColor(this->skyColor, this->fadeTime);
 
 }
@@ -162,4 +178,8 @@
 	if (this->windBuffer != NULL)
 		ResourceManager::getInstance()->unload(this->windBuffer);
+  
+  // Restore the old cloud- and sky color
+  CloudEffect::changeCloudColor(this->oldCloudColor, this->fadeTime);
+  CloudEffect::changeSkyColor(this->oldSkyColor, this->fadeTime);
 }
 
Index: trunk/src/lib/graphics/effects/snow_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/snow_effect.h	(revision 9112)
+++ trunk/src/lib/graphics/effects/snow_effect.h	(revision 9235)
@@ -16,4 +16,5 @@
 class PlaneEmitter;
 class PNode;
+class CloudEffect;
 
 #include "sound_source.h"
@@ -77,4 +78,16 @@
         this->snowWindForce = force;
     }
+    inline void setCloudColor(float colorX, float colorY, float colorZ)
+    {
+      this->cloudColor = Vector(colorX, colorY, colorZ);
+    }
+    inline void setSkyColor(float colorX, float colorY, float colorZ)
+    {
+      this->skyColor = Vector(colorX, colorY, colorZ);
+    }
+    inline void setFadeTime(float time)
+    {
+      this->fadeTime = time;
+    }
 
     inline void setSnowOption(const std::string& option) {
@@ -97,4 +110,5 @@
     float         angle, randomAngle;
     float         alpha;
+    float         fadeTime;
     Vector        snowCoord;
     Vector2D      snowSize;
@@ -110,4 +124,8 @@
     OrxSound::SoundBuffer*    windBuffer;
 
+    Vector oldSkyColor;
+    Vector oldCloudColor;
+    Vector skyColor;
+    Vector cloudColor;
 };
 
Index: trunk/src/lib/graphics/importer/bsp_manager.cc
===================================================================
--- trunk/src/lib/graphics/importer/bsp_manager.cc	(revision 9112)
+++ trunk/src/lib/graphics/importer/bsp_manager.cc	(revision 9235)
@@ -53,4 +53,5 @@
 {
 
+  this->lastTex = -1;
   this->parent = parent;
   /*// open a BSP file
@@ -101,4 +102,6 @@
   return 0;
 }
+
+
 /*
 BspManager::BspManager(const char* fileName, float scale)
@@ -270,5 +273,5 @@
         const float dMaxs = dir.x*(float)curLeaf.maxs[0] +dir.y*(float)curLeaf.maxs[1] +dir.z*(float)curLeaf.maxs[2] - dist;
 
-        if(dMins < -50.0 && dMaxs < -  50.0) {
+        if(dMins < -70.0 && dMaxs < -70.0) {
           continue;
         }
@@ -1371,7 +1374,7 @@
   else
   {
-    if( this->outputFraction == 1.0f)
+    if( this->outputFraction == 1.0f) // No collision Detected
     {
-      if( this->outputAllSolid )
+      if( this->outputAllSolid ) 
       {
         this->collPlane = new plane;
@@ -1382,5 +1385,5 @@
         SolidFlag = true;
       }
-      else
+      else      // No collision happened
       {
         yCollisionDown = false;
@@ -1388,9 +1391,8 @@
       }
     }
-    else
+    else           // A collision has happended
     {
       yCollisionDown = true;
       collPos = position + (down - position) * this->outputFraction;
-      this->out = collPos;        // why this????
     }
   }
Index: trunk/src/lib/graphics/importer/md2/md2Model.cc
===================================================================
--- trunk/src/lib/graphics/importer/md2/md2Model.cc	(revision 9112)
+++ trunk/src/lib/graphics/importer/md2/md2Model.cc	(revision 9235)
@@ -40,5 +40,5 @@
 
 //! list of all different animations a std md2model supports
-sAnim MD2Model::animationList[21] =
+sAnim MD2Model::animationList[22] =
   {
  // begin, end, fps, interruptable
@@ -64,4 +64,5 @@
     { 190, 197,  10, 0 },   //!< DEATH_FALLBACKSLOW
     { 198, 198,  5, 1 },   //!< BOOM
+    {  199, 204, 10, 1 },  //!< WALK (only for spectial models)
   };
 
Index: trunk/src/lib/graphics/importer/md2/md2Model.h
===================================================================
--- trunk/src/lib/graphics/importer/md2/md2Model.h	(revision 9112)
+++ trunk/src/lib/graphics/importer/md2/md2Model.h	(revision 9235)
@@ -30,6 +30,6 @@
 #define MD2_VERSION                     8                                        //!< the md2 version in the header
 #define MD2_MAX_TRIANGLES               4096                                     //!< maximal triangles count
-#define MD2_MAX_VERTICES                2048                                     //!< maximal vertices count
-#define MD2_MAX_TEXCOORDS               2048                                     //!< maximal tex coordinates
+#define MD2_MAX_VERTICES                3048                                     //!< maximal vertices count
+#define MD2_MAX_TEXCOORDS               3048                                     //!< maximal tex coordinates
 #define MD2_MAX_FRAMES                  512                                      //!< maximal frames
 #define MD2_MAX_SKINS                   32                                       //!< maximal skins
@@ -92,4 +92,5 @@
     DEATH_FALLBACKSLOW,
     BOOM,
+    WALK,
 
     MAX_ANIMATIONS
@@ -180,5 +181,5 @@
   static sVec3D       anorms[NUM_VERTEX_NORMALS];       //!< the anormals
   static float        anormsDots[SHADEDOT_QUANT][256];  //!< the anormals dot products
-  static sAnim        animationList[21];                //!< the anomation list
+  static sAnim        animationList[22];                //!< the anomation list
    //! again one of these strange id software parts
   float*              shadeDots;
Index: trunk/src/lib/gui/gl/glgui_handler.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_handler.cc	(revision 9112)
+++ trunk/src/lib/gui/gl/glgui_handler.cc	(revision 9235)
@@ -33,4 +33,5 @@
 /// TAKE THIS OUT OF HERE.
 #include "graphics_engine.h"
+#include "loading/resource_manager.h"
 
 namespace OrxGui
@@ -74,4 +75,7 @@
     this->_cursor->show();
     this->_cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY()));
+
+    _cursor->loadTextureSequence(ResourceManager::getInstance()->getDataDir() + "/" + "maps/reap_mouse/reap_mouse_##.png", 1, 49);
+
   }
 
Index: trunk/src/lib/network/handshake.cc
===================================================================
--- trunk/src/lib/network/handshake.cc	(revision 9112)
+++ trunk/src/lib/network/handshake.cc	(revision 9235)
@@ -43,4 +43,6 @@
 
   candel_id = registerVarId( new SynchronizeableInt( &localState.canDel, &remoteState.canDel, "canDel", PERMISSION_ALL ) );
+  
+  registerVar( new SynchronizeableString( &localState.preferedNickName, &remoteState.preferedNickName, "preferedNickName", PERMISSION_ALL ) );
 
   localState.completed = 0;
Index: trunk/src/lib/network/handshake.h
===================================================================
--- trunk/src/lib/network/handshake.h	(revision 9112)
+++ trunk/src/lib/network/handshake.h	(revision 9235)
@@ -28,4 +28,7 @@
   
   std::string errorString;
+  
+  //additional data
+  std::string preferedNickName;
 };
 
@@ -43,4 +46,7 @@
     inline bool       allowDel(){ return localState.canDel == 1; }
     inline void       del(){ localState.canDel = 1; }
+    
+    inline void       setPreferedNickName( const std::string & nick ){ localState.preferedNickName = nick; }
+    inline std::string getPreferedNickName(){ return remoteState.preferedNickName; }
     
     virtual void varChangeHandler( std::list<int> & id );
Index: trunk/src/lib/network/network_game_manager.cc
===================================================================
--- trunk/src/lib/network/network_game_manager.cc	(revision 9112)
+++ trunk/src/lib/network/network_game_manager.cc	(revision 9235)
@@ -42,4 +42,6 @@
 #include "multiplayer_team_deathmatch.h"
 
+#include "preferences.h"
+
 
 /* using namespace std is default, this needs to be here */
@@ -99,4 +101,5 @@
   std::string playableModel = rules.getPlayableModelFileName( userId, team, playableClassId );
   std::string playableTexture = rules.getPlayableModelFileName( userId, team, playableClassId );
+  float       playableScale = rules.getPlayableScale( userId, team, playableClassId );
   
   BaseObject * bo = Factory::fabricate( playableClassId );
@@ -107,8 +110,7 @@
   Playable & playable = *(dynamic_cast<Playable*>(bo));
   
-  if ( playableTexture != "" )
-    playable.loadMD2Texture( playableTexture );
-  if ( playableModel != "" )
-    playable.loadModel( playableModel );
+  playable.loadMD2Texture( playableTexture );
+  
+  playable.loadModel( playableModel, 100.0f );
   playable.setOwner( userId );
   playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() );
@@ -125,4 +127,7 @@
   stats->setPlayableUniqueId( playable.getUniqueID() );
   stats->setModelFileName( playableModel );
+  
+  if ( userId == 0 )
+    stats->setNickName( Preferences::getInstance()->getString( "multiplayer", "nickname", "Server" ) );
   
   if ( rules.isA( CL_MULTIPLAYER_TEAM_DEATHMATCH ) )
Index: trunk/src/lib/network/network_stream.cc
===================================================================
--- trunk/src/lib/network/network_stream.cc	(revision 9112)
+++ trunk/src/lib/network/network_stream.cc	(revision 9235)
@@ -37,4 +37,5 @@
 #include "network_log.h"
 
+#include "player_stats.h"
 
 #include "lib/util/loading/factory.h"
@@ -153,4 +154,7 @@
   assert( peers[0].handshake == NULL );
   peers[0].handshake = hs;
+  
+  hs->setPreferedNickName( Preferences::getInstance()->getString( "multiplayer", "nickname", "Player" ) );
+  
 //   peers[0].handshake->setSynchronized( true );
   //this->connectSynchronizeable(*hs);
@@ -392,4 +396,9 @@
               {
                 handleNewClient( it->second.userId );
+                
+                if ( PlayerStats::getStats( it->second.userId ) && it->second.handshake->getPreferedNickName() != "" )
+                {
+                  PlayerStats::getStats( it->second.userId )->setNickName( it->second.handshake->getPreferedNickName() );
+                }
               }
               
Index: trunk/src/lib/network/player_stats.cc
===================================================================
--- trunk/src/lib/network/player_stats.cc	(revision 9112)
+++ trunk/src/lib/network/player_stats.cc	(revision 9235)
@@ -22,4 +22,6 @@
 #include "state.h"
 #include "shared_network_data.h"
+
+#include "preferences.h"
 
 #include "debug.h"
@@ -187,5 +189,5 @@
 void PlayerStats::setNickName( std::string nick )
 {
-  if ( isServer() )
+  if ( SharedNetworkData::getInstance()->isGameServer() )
   {
     this->nickName = nick;
@@ -226,4 +228,6 @@
   if ( getStats( SharedNetworkData::getInstance()->getHostID() ) )
     getStats( SharedNetworkData::getInstance()->getHostID() )->setNickName( newNick );
+    
+  Preferences::getInstance()->setString( "multiplayer", "nickname", newNick );
 }
 
Index: trunk/src/lib/particles/particle_system.cc
===================================================================
--- trunk/src/lib/particles/particle_system.cc	(revision 9112)
+++ trunk/src/lib/particles/particle_system.cc	(revision 9235)
@@ -460,5 +460,5 @@
     int i = 1;
     Particle* tmpPart = this->deadList;
-    while (tmpPart = tmpPart->next) ++i;
+    while (tmpPart = tmpPart->next) { ++i; }
     PRINT(0)("count: %d\n", i);
   }
Index: trunk/src/lib/script_engine/script.cc
===================================================================
--- trunk/src/lib/script_engine/script.cc	(revision 9112)
+++ trunk/src/lib/script_engine/script.cc	(revision 9235)
@@ -26,4 +26,5 @@
 CREATE_SCRIPTABLE_CLASS(Script, CL_SCRIPT,
                     addMethod("addObject", ExecutorLua2<Script,const std::string&, const std::string& >(&Script::addObject))
+                    ->addMethod("registerClass", ExecutorLua1<Script,const std::string&>(&Script::registerClass))
                     ->addMethod("selectFunction", ExecutorLua2ret<Script, bool, const std::string&, int >(&Script::selectFunction))
                     ->addMethod("executeFunction", ExecutorLua0ret<Script,bool >(&Script::executeFunction))
@@ -78,5 +79,4 @@
 bool Script::loadFile(const std::string& filename)
  {
-   this->setName(filename);
    std::string filedest(ResourceManager::getInstance()->getDataDir());
    filedest += "scripts/" + filename;
@@ -95,10 +95,9 @@
    if(error == 0)
    {
-     
+     currentFile = filename;
      error = lua_pcall(luaState, 0, 0, 0);
 
      if(error == 0)
      {
-      currentFile = filename;
       return true;
      }
@@ -358,6 +357,7 @@
    bool success = false;
    
-   //success = this->registerClass(std::string("Vector"));
-    success = this->registerClass("ScriptTrigger");
+   //this->registerClass(std::string("Vector"));
+    this->registerClass("ScriptTrigger");
+  //  this->registerClass("AttractorMine");
 
    return success;
@@ -365,5 +365,5 @@
  
  
- bool Script::registerClass( const std::string& className)
+ void Script::registerClass( const std::string& className)
  {
    BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS);
@@ -378,16 +378,29 @@
        tmpObj.name = "";
        registeredObjects.push_back(tmpObj);
+       return;
+     }
+   }
+ 
+ }
+
+ bool Script::classIsRegistered(const std::string& type)
+ {
+   for(std::list<WorldObject>::const_iterator it = registeredObjects.begin(); it != registeredObjects.end(); it++ )
+   {
+     if( (*it).type == type)
+     {
        return true;
      }
    }
    return false;
- 
- }
-
- bool Script::classIsRegistered(const std::string& type)
+ }
+
+
+
+ bool Script::objectIsAdded(const std::string& name)
  {
    for(std::list<WorldObject>::const_iterator it = registeredObjects.begin(); it != registeredObjects.end(); it++ )
    {
-     if( (*it).type == type)
+     if( (*it).name == name)
      {
        return true;
@@ -395,19 +408,5 @@
    }
    return false;
- }
-
-
-
- bool Script::objectIsAdded(const std::string& name)
- {
-   for(std::list<WorldObject>::const_iterator it = registeredObjects.begin(); it != registeredObjects.end(); it++ )
-   {
-     if( (*it).name == name)
-     {
-       return true;
-     }
-   }
-   return false;
-
-
- }
+
+
+ }
Index: trunk/src/lib/script_engine/script.h
===================================================================
--- trunk/src/lib/script_engine/script.h	(revision 9112)
+++ trunk/src/lib/script_engine/script.h	(revision 9235)
@@ -32,4 +32,5 @@
     bool loadFile(const std::string& filename);
     void addObject( const std::string& className,const std::string& objectName);
+    void registerClass(const std::string& className);                           //!< Register a class but dont add any instances 
 
     /// QUERRYING
@@ -64,5 +65,4 @@
     int  reportError(int error);                      //!< Get errormessage from the lua stack and print it.
     bool registerStandartClasses();                   //!< Register all the classes that the script might need
-    bool registerClass(const std::string& className); //!< Register a class but dont add any instances 
     bool classIsRegistered(const std::string& type);  //!< Checks wheter the class "type" has already been registered with the script
     bool objectIsAdded(const std::string& name);      //!< Checks wheter the object "name" has already been added to the script
Index: trunk/src/lib/sound/sound_engine.cc
===================================================================
--- trunk/src/lib/sound/sound_engine.cc	(revision 9112)
+++ trunk/src/lib/sound/sound_engine.cc	(revision 9235)
@@ -352,5 +352,5 @@
     if ((errorCode = alGetError()) != AL_NO_ERROR)
     {
-      PRINTF(1)("Error %s (line:%d): '%s'\n", error.c_str(), line, SoundEngine::getALErrorString(errorCode));
+      //PRINTF(1)("Error %s (line:%d): '%s'\n", error.c_str(), line, SoundEngine::getALErrorString(errorCode));
       return false;
     }
