Index: orxonox/trunk/src/util/animation/animation3d.h
===================================================================
--- orxonox/trunk/src/util/animation/animation3d.h	(revision 4905)
+++ orxonox/trunk/src/util/animation/animation3d.h	(revision 4906)
@@ -9,5 +9,5 @@
 class PNode;
 
-#define DELTA_X_3D 0.05  //!< the percentag of the distance that doesnt have to be done by neg_exp (asymptotical) ~ maschinendelta
+#define DELTA_X_3D 0.05  //!< the percentag of the distance that doesn't have to be done by neg_exp (asymptotical) ~ maschinendelta
 
 //! KeyFrame3D Struct
@@ -36,5 +36,7 @@
   virtual void rewind();
 
-  void addKeyFrame(Vector position, Quaternion direction, float time, ANIM_FUNCTION animFuncMov = ANIM_DEFAULT_FUNCTION, ANIM_FUNCTION animFuncRot = ANIM_NULL);
+  void addKeyFrame(Vector position, Quaternion direction,
+                   float time, ANIM_FUNCTION animFuncMov = ANIM_DEFAULT_FUNCTION,
+                   ANIM_FUNCTION animFuncRot = ANIM_NULL);
   //  void addKeyFrame(KeyFrame3D* frame);
 
Index: orxonox/trunk/src/world_entities/player.cc
===================================================================
--- orxonox/trunk/src/world_entities/player.cc	(revision 4905)
+++ orxonox/trunk/src/world_entities/player.cc	(revision 4906)
@@ -49,8 +49,8 @@
   Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
 
-  this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0);
-  this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1);
-  this->weaponMan->addWeapon(wpRight, W_CONFIG2);
-  this->weaponMan->addWeapon(wpLeft, W_CONFIG2);
+  this->weaponMan->addWeapon(wpRight, WM_CONFIG0, WM_SLOT0);
+  this->weaponMan->addWeapon(wpLeft, WM_CONFIG1, WM_SLOT1);
+  this->weaponMan->addWeapon(wpRight, WM_CONFIG2);
+  this->weaponMan->addWeapon(wpLeft, WM_CONFIG2);
 }
 
@@ -83,8 +83,8 @@
   Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
 
-  this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0);
-  this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1);
-  this->weaponMan->addWeapon(wpRight, W_CONFIG2);
-  this->weaponMan->addWeapon(wpLeft, W_CONFIG2);
+  this->weaponMan->addWeapon(wpRight, WM_CONFIG0, WM_SLOT0);
+  this->weaponMan->addWeapon(wpLeft, WM_CONFIG1, WM_SLOT1);
+  this->weaponMan->addWeapon(wpRight, WM_CONFIG2);
+  this->weaponMan->addWeapon(wpLeft, WM_CONFIG2);
 }
 
Index: orxonox/trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- orxonox/trunk/src/world_entities/weapons/test_gun.cc	(revision 4905)
+++ orxonox/trunk/src/world_entities/weapons/test_gun.cc	(revision 4906)
@@ -70,9 +70,9 @@
       animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT);
 
-      animation2->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
-      animation2->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
-
-      animation3->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
-      animation3->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
+      animation2->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+      animation2->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+      animation3->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+      animation3->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
     }
   else if( this->leftRight == W_RIGHT)
@@ -100,6 +100,6 @@
   //ObjectManager::getInstance()->debug();
 
-  this->setStateDuration(WS_SHOOTING, .2);
-  this->setStateDuration(WS_RELOADING, .5);
+  this->setStateDuration(WS_SHOOTING, .4);
+  this->setStateDuration(WS_RELOADING, 1);
   //this->setStateDuration(WS_ACTIVATING, .4);
   //this->setStateDuration(WS_DEACTIVATING, .4);
Index: orxonox/trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- orxonox/trunk/src/world_entities/weapons/weapon.cc	(revision 4905)
+++ orxonox/trunk/src/world_entities/weapons/weapon.cc	(revision 4906)
@@ -81,6 +81,7 @@
   this->emissionPoint.setParent(this);
 
-  this->active = true;
   this->projectile = NULL;
+
+  this->hideInactive = true;
 
   this->minCharge = 1.0;
@@ -171,10 +172,16 @@
 void Weapon::requestAction(WeaponAction action)
 {
-  if (this->requestedAction != WA_NONE)
-    return;
-  else
-  {
+  if (likely(this->isActive()))
+  {
+    if (this->requestedAction != WA_NONE)
+      return;
     printf("next action will be %s in %f seconds\n", actionToChar(action), this->stateDuration);
     this->requestedAction = action;
+  }
+  //else
+  else if (unlikely(action == WA_ACTIVATE))
+  {
+    this->currentState = WS_ACTIVATING;
+    this->requestAction(WA_ACTIVATE);
   }
 }
@@ -215,7 +222,8 @@
 bool Weapon::execute()
 {
-
+#if DEBUG > 4
   PRINTF(4)("trying to execute action %s\n", actionToChar(this->requestedAction));
   this->debug();
+#endif
 
   switch (this->requestedAction)
@@ -246,5 +254,5 @@
 bool Weapon::activateW()
 {
-//  if (this->currentState == WS_INACTIVE)
+  if (this->currentState == WS_INACTIVE)
   {
         // play Sound
@@ -256,6 +264,6 @@
     PRINTF(4)("Activating the Weapon %s\n", this->getName());
     this->activate();
-    this->active = true;
     // setting up for next action
+    this->currentState = WS_ACTIVATING;
     this->stateDuration = this->times[WA_ACTIVATE] + this->stateDuration;
   }
@@ -280,6 +288,6 @@
         // deactivate
     this->deactivate();
-    this->active = false;
         // setting up for next action
+    this->currentState = WS_DEACTIVATING;
     this->stateDuration = this->times[WA_DEACTIVATE] + this->stateDuration;
   }
@@ -305,4 +313,5 @@
         // setting up for the next state
     this->requestedAction = WA_NONE;
+    this->currentState = WS_CHARGING;
     this->stateDuration = this->times[WA_CHARGE] + this->stateDuration;
   }
@@ -334,4 +343,5 @@
           // setting up for the next state
     this->stateDuration = this->times[WA_SHOOT] + this->stateDuration;
+    this->currentState = WS_SHOOTING;
     this->requestedAction = WA_NONE;
   }
@@ -379,4 +389,5 @@
 
   this->requestedAction = WA_NONE;
+  this->currentState = WS_RELOADING;
   this->stateDuration = this->times[WA_RELOAD] + this->stateDuration;
 
@@ -387,5 +398,5 @@
  * tick signal for time dependent/driven stuff
 */
-void Weapon::tick(float dt)
+void Weapon::tickW(float dt)
 {
   // setting up the timing properties
@@ -394,14 +405,19 @@
   if (this->isActive())
   {
-    if (this->stateDuration <= 0.0 && this->requestedAction != WA_NONE)
-    {
-      this->stateDuration = -dt;
-      this->execute();
-    }
-  }
-  else
-    if (this->requestedAction == WA_ACTIVATE)
-      this->activate();
-
+    if (this->stateDuration <= 0.0)
+    {
+      if (unlikely (this->currentState != WS_DEACTIVATING))
+        this->currentState = WS_IDLE;
+      else
+        this->currentState = WS_INACTIVE;
+
+      if (this->requestedAction != WA_NONE)
+      {
+        this->stateDuration = -dt;
+        this->execute();
+      }
+    }
+  }
+  tick(dt);
 }
 
@@ -569,4 +585,7 @@
       return "idle";
       break;
+    case WS_INACTIVE:
+      return "inactive";
+      break;
     default:
       return "none";
Index: orxonox/trunk/src/world_entities/weapons/weapon.h
===================================================================
--- orxonox/trunk/src/world_entities/weapons/weapon.h	(revision 4905)
+++ orxonox/trunk/src/world_entities/weapons/weapon.h	(revision 4906)
@@ -81,6 +81,8 @@
     float increaseEnergy(float energyToAdd);
 
-    /** @returns true if the Weapon is Active */
-    inline bool isActive() const { return this->active; };
+    /** @returns true if the Weapon is Active  (this is used to check if the weapon must be drawn)*/
+    inline bool isActive() const { return (this->currentState == WS_INACTIVE)?false:true; };
+    /** @returns true if the weapon must be drawn */
+    inline bool isVisible() const { return (this->currentState != WS_INACTIVE || !this->hideInactive)?true:false; };
 
     // FUNCTIONS TO SET THE WEAPONS PROPERTIES.
@@ -113,7 +115,9 @@
 
     Animation3D* getAnimation(WeaponState state, PNode* node = NULL);
+    Animation3D* copyAnimation(WeaponState from, WeaponState to);
 
     // FLOW
-    virtual void tick(float dt);
+    void tickW(float dt); //!< this is a function that must be called by the weaponManager, or any other weaponHandler, all other functions are handled from within
+    virtual void tick(float dt) {};
     virtual void draw();
 
@@ -175,5 +179,4 @@
     PNode                emissionPoint;                   //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default)
 
-    bool                 active;                          //!< states wheter the weapon is enabled or not
     bool                 hideInactive;                    //!< Hides the Weapon if it is inactive
     bool                 chargeable;                      //!< if the Weapon is charcheable
Index: orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- orxonox/trunk/src/world_entities/weapons/weapon_manager.cc	(revision 4905)
+++ orxonox/trunk/src/world_entities/weapons/weapon_manager.cc	(revision 4906)
@@ -75,5 +75,5 @@
       this->configs[i].slots[j] = NULL;
   }
-  this->currConfID = W_CONFIG0;
+  this->currConfID = WM_CONFIG0;
 
 
@@ -141,5 +141,5 @@
  *
  * if you add explicitly a weapon at config:n, slot:m, the weapon placed at this location will be
- * replaced by the weapon specified. if you use the W_FREE_SLOT, the manager will look for a free
+ * replaced by the weapon specified. if you use the WM_FREE_SLOT, the manager will look for a free
  * slot in this weaponconfiguration. if there is non, the weapon won't be added and there will be
  * a error message.
@@ -147,5 +147,5 @@
 void WeaponManager::addWeapon(Weapon* weapon, int configID, int slotID)
 {
-  if( slotID == W_FREE_SLOT)
+  if( slotID == WM_FREE_SLOT)
   {
     int freeSlot = this->getNextFreeSlot( configID);
@@ -187,5 +187,5 @@
   lastConfID = this->currConfID;
   for(i = this->currConfID + 1; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
-  if( i == W_MAX_CONFIGS) this->currConfID = W_CONFIG0;
+  if( i == W_MAX_CONFIGS) this->currConfID = WM_CONFIG0;
   else this->currConfID = i;
 
@@ -241,9 +241,9 @@
 {
   Weapon* w;
-  for (int j = 0; j < 4; ++j )
-    for(int i = 0; i < W_MAX_SLOTS; ++i)
-  {
-    w = this->configs[j].slots[i];
-    if( w != NULL) w->tick(dt);
+  for(int i = 0; i < W_MAX_SLOTS; ++i)
+  {
+    w = this->configs[this->currConfID].slots[i];
+    if( w != NULL && w->isActive())
+      w->tickW(dt);
   }
 
@@ -262,5 +262,5 @@
   {
     w = this->configs[j].slots[i];
-    if( w != NULL)
+    if( w != NULL && w->isVisible())
       w->draw();
   }
Index: orxonox/trunk/src/world_entities/weapons/weapon_manager.h
===================================================================
--- orxonox/trunk/src/world_entities/weapons/weapon_manager.h	(revision 4905)
+++ orxonox/trunk/src/world_entities/weapons/weapon_manager.h	(revision 4906)
@@ -39,21 +39,30 @@
 
 //! this is an identifier for the weapon config
-#define    W_CONFIG0     0
-#define    W_CONFIG1     1
-#define    W_CONFIG2     2
-#define    W_CONFIG3     3
+typedef enum
+{
+  WM_CONFIG0           = 0,
+  WM_CONFIG1           = 1,
+  WM_CONFIG2           = 2,
+  WM_CONFIG3           = 3,
 
+  WM_CONFIGCOUNT       = 4
+} WM_CONFIG;
 
 //! this is an identifier for the slot. there are up to 8 weapon slots -> this means there can't be more than 8 weapons at the same time
-#define    W_SLOT0       0
-#define    W_SLOT1       1
-#define    W_SLOT2       2
-#define    W_SLOT3       3
-#define    W_SLOT4       4
-#define    W_SLOT5       5
-#define    W_SLOT6       6
-#define    W_SLOT7       7
-#define    W_FREE_SLOT   99
+typedef enum
+{
+  WM_SLOT0              = 0,
+  WM_SLOT1              = 1,
+  WM_SLOT2              = 2,
+  WM_SLOT3              = 3,
+  WM_SLOT4              = 4,
+  WM_SLOT5              = 5,
+  WM_SLOT6              = 6,
+  WM_SLOT7              = 7,
 
+  WM_SLOT_COUNT         = 8,
+
+  WM_FREE_SLOT          = -1
+} WM_SLOT;
 
 //! this is a weapon Configuration: it has up to 8 slots
@@ -77,6 +86,6 @@
     void setSlotCount(int nrOfSlots);
 
-    void addWeapon(Weapon* weapon, int configID = W_CONFIG0, int slotID = W_FREE_SLOT);
-    void removeWeapon(Weapon* weapon, int configID = W_CONFIG0);
+    void addWeapon(Weapon* weapon, int configID = WM_CONFIG0, int slotID = WM_FREE_SLOT);
+    void removeWeapon(Weapon* weapon, int configID = WM_CONFIG0);
     void nextWeaponConf();
 
