Index: orxonox/trunk/src/world_entities/player.cc
===================================================================
--- orxonox/trunk/src/world_entities/player.cc	(revision 3879)
+++ orxonox/trunk/src/world_entities/player.cc	(revision 3881)
@@ -44,5 +44,4 @@
   */
   this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
-  //this->model = (Model*)ResourceManager::getInstance()->load("models/weapon_packet.obj", OBJ, RP_CAMPAIGN);
   travelSpeed = 15.0;
   velocity = new Vector();
@@ -53,13 +52,12 @@
   //weapons:
   this->weaponMan = new WeaponManager();
-  Weapon* wpRight = new TestGun(this, new Vector(-2.6, 0.1, 3.0), new Quaternion(), 0);
-  Weapon* wpLeft = new TestGun(this, new Vector(-2.6, 0.1, -3.0), new Quaternion(), 1);
+  Weapon* wpRight = new TestGun(this,Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
+  Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
   
   this->weaponMan->addWeapon(wpRight, W_CONFIG0);
   this->weaponMan->addWeapon(wpLeft, W_CONFIG1);
-
-  //this->weapons->add(wpRight);
-  //this->activeWeapon = wpRight;
-  //this->activeWeaponL = wpLeft;
+  this->weaponMan->addWeapon(wpRight, W_CONFIG2);
+  this->weaponMan->addWeapon(wpLeft, W_CONFIG2);
+
 }
 
Index: orxonox/trunk/src/world_entities/test_gun.cc
===================================================================
--- orxonox/trunk/src/world_entities/test_gun.cc	(revision 3879)
+++ orxonox/trunk/src/world_entities/test_gun.cc	(revision 3881)
@@ -40,5 +40,5 @@
    creates a new weapon
 */
-TestGun::TestGun (PNode* parent, Vector* coordinate, Quaternion* direction, int leftRight) 
+TestGun::TestGun (PNode* parent, const Vector& coordinate, const Quaternion& direction, int leftRight) 
   :  Weapon (parent, coordinate, direction) 
 {
@@ -127,5 +127,5 @@
 void TestGun::fire()
 {
-  if( this->localTime < this->idleTime)
+  if( !this->hasWeaponIdleTimeElapsed())
     {
       this->weaponIdle();
@@ -201,5 +201,5 @@
 		    this->getAbsCoor ().y, 
 		    this->getAbsCoor ().z);
-      
+
       this->getAbsDir ().matrix (matrix);
       glMultMatrixf((float*)matrix);
@@ -228,5 +228,5 @@
 		this->dummy1->getAbsCoor ().y, 
 		this->dummy1->getAbsCoor ().z);
-
+  
   this->dummy1->getAbsDir ().matrix (matrix);
   glMultMatrixf((float*)matrix);
Index: orxonox/trunk/src/world_entities/test_gun.h
===================================================================
--- orxonox/trunk/src/world_entities/test_gun.h	(revision 3879)
+++ orxonox/trunk/src/world_entities/test_gun.h	(revision 3881)
@@ -37,5 +37,5 @@
 
  public:
-  TestGun (PNode* parent, Vector* coordinate, Quaternion* direction, int leftRight);
+  TestGun (PNode* parent, const Vector& coordinate, const Quaternion& direction, int leftRight);
   virtual ~TestGun ();
 
Index: orxonox/trunk/src/world_entities/weapon.cc
===================================================================
--- orxonox/trunk/src/world_entities/weapon.cc	(revision 3879)
+++ orxonox/trunk/src/world_entities/weapon.cc	(revision 3881)
@@ -37,6 +37,4 @@
 WeaponManager::WeaponManager(int nrOfSlots) 
 {
-  this->nrOfSlots = nrOfSlots;
-  
   for(int i = 0; i < W_MAX_CONFIGS; ++i)
     {
@@ -45,7 +43,6 @@
 	this->configs[i].slots[j] = NULL;
     }
-
+  this->nrOfSlots = nrOfSlots;
   this->currConfID = W_CONFIG0;
-  this->configs[this->currConfID].bUsed = true;
 }
 
@@ -53,7 +50,14 @@
 WeaponManager::~WeaponManager() 
 {
-  /* i dont have to delete the weapons itself, because they are 
+  /* 
+     i dont have to delete the weapons itself, because they are 
      worldentities and therefore in the entities list of the world
   */
+  for(int i = 0; i < W_MAX_CONFIGS; ++i)
+    {
+      this->configs[i].bUsed = false;
+      for(int j = 0; j < W_MAX_SLOTS; ++j)
+	this->configs[i].slots[j] = NULL;
+    }
 }
 
@@ -101,8 +105,16 @@
 
    if there are multiple weapon configurations defined by the manager, use this to switch between them
+   this function will deactivate the weapons first, change the config and reactivate them later
 */
 void WeaponManager::nextWeaponConf() 
 {
   PRINTF(4)("Changing weapon configuration: from %i\n", this->currConfID);
+
+  Weapon* w;
+  for(int i = 0; i < W_MAX_SLOTS; ++i)
+    {
+      w = this->configs[this->currConfID].slots[i];
+      if( w != NULL) w->deactivate();
+    }
   int i;
   for(i = this->currConfID + 1; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
@@ -110,4 +122,10 @@
   else this->currConfID = i;  
   PRINTF(4)("\tto %i\n", this->currConfID);
+
+  for(int i = 0; i < W_MAX_SLOTS; ++i)
+    {
+      w = this->configs[this->currConfID].slots[i];
+      if( w != NULL) w->activate();
+    }
 }
 
@@ -181,10 +199,10 @@
    creates a new weapon
 */
-Weapon::Weapon (PNode* parent, Vector* coordinate, Quaternion* direction) 
+Weapon::Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction) 
   : WorldEntity()
 {
   parent->addChild(this, PNODE_ALL);
-  this->setRelCoor(*coordinate);
-  this->setRelDir(*direction);
+  this->setRelCoor(coordinate);
+  this->setRelDir(direction);
   WorldInterface* wi = WorldInterface::getInstance();
   this->worldEntities = wi->getEntityList();
@@ -293,48 +311,7 @@
 {}
 
-/**
-   \brief sets a weapon idle time
-   \param idle time in ms
-
-   a weapon idle time is the time spend after a shoot until the weapon can
-   shoot again
-*/
-void Weapon::setWeaponIdleTime(float time)
-{
-  this->idleTime = time;
-}
-
-/**
-   \brief gets the weapon idle time
-   \returns idle time in ms
-
-   a weapon idle time is the time spend after a shoot until the weapon can
-   shoot again
-*/
-float Weapon::getWeaponIdleTime(void)
-{
-  return this->idleTime;
-}
-
-/**
-   \brief checks if the idle time is elapsed
-   \return true if time is elapsed
-
-   a weapon idle time is the time spend after a shoot until the weapon can
-   shoot again
-*/
-bool Weapon::hasWeaponIdleTimeElapsed(void)
-{
-  return (this->localTime>this->idleTime)?true:false;
-}
-
-
-/**
-   \brief fires the weapon
-   
-   this is called from the player.cc, when fire-button is been pushed
-*/
-void Weapon::fire()
-{}
+
+
+
 
 
Index: orxonox/trunk/src/world_entities/weapon.h
===================================================================
--- orxonox/trunk/src/world_entities/weapon.h	(revision 3879)
+++ orxonox/trunk/src/world_entities/weapon.h	(revision 3881)
@@ -88,5 +88,4 @@
 
  private:
-  int nrOfConfigs;                      //<! number of configurations defined
   int nrOfSlots;                        //<! number of weapon slots a ship has
   int currConfID;                       //<! the currently selected config
@@ -101,5 +100,5 @@
 
  public:
-  Weapon (PNode* parent, Vector* coordinate, Quaternion* direction);
+  Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction);
   virtual ~Weapon ();
   
@@ -115,8 +114,35 @@
   bool isActive(void);
 
-  void setWeaponIdleTime(float time);
-  float getWeaponIdleTime(void);
-  bool hasWeaponIdleTimeElapsed(void);
 
+  /**
+     \brief sets a weapon idle time
+     \param idle time in ms
+     
+     a weapon idle time is the time spend after a shoot until the weapon can
+     shoot again
+  */
+  inline void setWeaponIdleTime(float time) { this->idleTime = time; }
+  /**
+     \brief gets the weapon idle time
+     \returns idle time in ms
+     
+     a weapon idle time is the time spend after a shoot until the weapon can
+     shoot again
+  */
+  inline float getWeaponIdleTime(void) const { return this->idleTime;}
+  /**
+     \brief checks if the idle time is elapsed
+     \return true if time is elapsed
+     
+     a weapon idle time is the time spend after a shoot until the weapon can
+   shoot again
+  */
+  inline bool hasWeaponIdleTimeElapsed(void) const { return (this->localTime>this->idleTime)?true:false; }
+
+  /**
+     \brief fires the weapon
+     
+     this is called from the player.cc, when fire-button is been pushed
+  */
   virtual void fire(void) = 0;
   virtual void hit (WorldEntity* weapon, Vector* loc);
