Index: orxonox/trunk/src/world_entities/weapons/test_bullet.cc
===================================================================
--- orxonox/trunk/src/world_entities/weapons/test_bullet.cc	(revision 4891)
+++ orxonox/trunk/src/world_entities/weapons/test_bullet.cc	(revision 4892)
@@ -19,7 +19,4 @@
 #include "test_bullet.h"
 
-#include "world_entity.h"
-#include "weapon.h"
-#include "null_parent.h"
 #include "model.h"
 #include "vector.h"
Index: orxonox/trunk/src/world_entities/weapons/test_bullet.h
===================================================================
--- orxonox/trunk/src/world_entities/weapons/test_bullet.h	(revision 4891)
+++ orxonox/trunk/src/world_entities/weapons/test_bullet.h	(revision 4892)
@@ -14,6 +14,4 @@
 class TestBullet : public Projectile
 {
-  friend class World;
-
  public:
   TestBullet (Weapon* weapon);
Index: orxonox/trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- orxonox/trunk/src/world_entities/weapons/weapon.cc	(revision 4891)
+++ orxonox/trunk/src/world_entities/weapons/weapon.cc	(revision 4892)
@@ -30,4 +30,8 @@
 #include "sound_engine.h"
 
+////////////////////
+// INITAILISATION //
+// SETTING VALUES //
+////////////////////
 /**
  * standard constructor
@@ -74,4 +78,5 @@
   this->requestedAction = WA_NONE;
   this->soundSource = new SoundSource(this);
+  this->emissionPoint.setParent(this);
 
   this->active = true;
@@ -86,4 +91,13 @@
 }
 
+
+/**
+ * sets the emissionPoint's relative position from the Weapon
+ * @param point the Point relative to the mass-point of the Weapon
+ */
+void Weapon::setEmissionPoint(const Vector& point)
+{
+  this->emissionPoint.setRelCoor(point);
+}
 
 /**
@@ -112,4 +126,9 @@
 }
 
+/////////////////
+//  EXECUTION  //
+// GAME ACTION //
+/////////////////
+
 /**
  * request an action that should be executed,
@@ -152,4 +171,7 @@
 }
 
+//////////////////////
+// WEAPON INTERNALS //
+//////////////////////
 /**
  * executes an action, and with it starts a new State.
@@ -169,125 +191,134 @@
   {
     case WA_SHOOT:
-      //if (likely(this->currentState != WS_INACTIVE))
-      {
-        if (this->minCharge <= this->energyLoaded)
-        {
+      this->fireW();
+      break;
+    case WA_CHARGE:
+      this->chargeW();
+      break;
+    case WA_RELOAD:
+      this->reloadW();
+      break;
+    case WA_DEACTIVATE:
+      this->deactivateW();
+      break;
+    case WA_ACTIVATE:
+      this->activateW();
+      break;
+  }
+}
+
+
+/**
+ *
+ * @return
+ */
+bool Weapon::activateW()
+{
+
+  if (this->currentState == WS_INACTIVE)
+  {
+        // play Sound
+    if (this->soundBuffers[WA_ACTIVATE] != NULL)
+      this->soundSource->play(this->soundBuffers[WA_ACTIVATE]);
+        // activate
+    PRINTF(5)("Activating the Weapon %s\n", this->getName());
+    this->activate();
+        // setting up for next action
+    this->requestedAction = WA_NONE;
+    this->stateDuration = this->times[WA_ACTIVATE] + this->stateDuration;
+  }
+}
+
+
+/**
+ *
+ * @return
+ */
+bool Weapon::deactivateW()
+{
+  if (this->currentState != WS_INACTIVE)
+  {
+    PRINTF(4)("Deactivating the Weapon %s\n", this->getName());
+        // play Sound
+    if (this->soundBuffers[WA_DEACTIVATE] != NULL)
+      this->soundSource->play(this->soundBuffers[WA_DEACTIVATE]);
+        // deactivate
+    this->deactivate();
+        // setting up for next action
+    this->requestedAction = WA_NONE;
+    this->stateDuration = this->times[WA_DEACTIVATE] + this->stateDuration;
+  }
+
+}
+
+/**
+ *
+ * @return
+ */
+bool Weapon::chargeW()
+{
+  if ( this->currentState != WS_INACTIVE && this->energyLoaded >= this->minCharge)
+  {
+        // playing Sound
+    if (this->soundBuffers[WA_CHARGE] != NULL)
+      this->soundSource->play(this->soundBuffers[WA_CHARGE]);
+        // charge
+    this->charge();
+        // setting up for the next state
+    this->requestedAction = WA_NONE;
+    this->stateDuration = this->times[WA_CHARGE] + this->stateDuration;
+  }
+  else // deactivate the Weapon if we do not have enough energy
+  {
+    this->requestedAction = WA_NONE;
+    this->requestAction(WA_RELOAD);
+  }
+
+}
+
+/**
+ *
+ * @return
+ */
+bool Weapon::fireW()
+{
+     //if (likely(this->currentState != WS_INACTIVE))
+  if (this->minCharge <= this->energyLoaded)
+  {
           // playing Sound
-          if (this->soundBuffers[WA_SHOOT] != NULL)
-            this->soundSource->play(this->soundBuffers[WA_SHOOT]);
+    if (this->soundBuffers[WA_SHOOT] != NULL)
+      this->soundSource->play(this->soundBuffers[WA_SHOOT]);
           // fire
-          this->fire();
+    this->fire();
+    this->energyLoaded -= this->minCharge;
           // setting up for the next state
-          this->stateDuration = this->times[WA_SHOOT] + this->stateDuration;
-          this->requestedAction = WA_NONE;
-        }
-        else  // reload if we still have the charge
-        {
-          this->requestedAction = WA_NONE;
-          this->requestAction(WA_RELOAD);
-        }
-      }
-      break;
-    case WA_CHARGE:
-      if ( this->currentState != WS_INACTIVE && this->energyLoaded >= this->minCharge)
-      {
-        // playing Sound
-        if (this->soundBuffers[WA_CHARGE] != NULL)
-         this->soundSource->play(this->soundBuffers[WA_CHARGE]);
-        // charge
-        this->charge();
-        // setting up for the next state
-        this->requestedAction = WA_NONE;
-        this->stateDuration = this->times[WA_CHARGE] + this->stateDuration;
-      }
-      else // deactivate the Weapon if we do not have enough energy
-      {
-        this->requestedAction = WA_NONE;
-        this->requestAction(WA_RELOAD);
-      }
-      break;
-    case WA_RELOAD:
-      //if (this->currentState != WS_INACTIVE && this->energy + this->energyLoaded >= this->minCharge)
-      {
-        // playing Sound
-        if (this->soundBuffers[WA_RELOAD] != NULL)
-          this->soundSource->play(this->soundBuffers[WA_RELOAD]);
-        // reload
-        this->reload();
-        // setting up for next action
-        this->requestedAction = WA_NONE;
-        this->stateDuration = this->times[WA_RELOAD] + this->stateDuration;
-      }
-      break;
-    case WA_DEACTIVATE:
-      if (this->currentState != WS_INACTIVE)
-      {
-        // play Sound
-        if (this->soundBuffers[WA_DEACTIVATE] != NULL)
-          this->soundSource->play(this->soundBuffers[WA_DEACTIVATE]);
-        // deactivate
-        this->deactivate();
-        // setting up for next action
-        this->requestedAction = WA_NONE;
-        this->stateDuration = this->times[WA_DEACTIVATE] + this->stateDuration;
-      }
-      break;
-    case WA_ACTIVATE:
-      if (this->currentState == WS_INACTIVE)
-      {
-        // play Sound
-        if (this->soundBuffers[WA_ACTIVATE] != NULL)
-          this->soundSource->play(this->soundBuffers[WA_ACTIVATE]);
-        // activate
-        this->activate();
-        // setting up for next action
-        this->requestedAction = WA_NONE;
-        this->stateDuration = this->times[WA_ACTIVATE] + this->stateDuration;
-      }
-      break;
-  }
-}
-
-/**
- * this activates the weapon
-*/
-void Weapon::activate()
-{
-  PRINTF(4)("Activating the Weapon %s\n", this->getName());
-
-  if (this->soundBuffers[WA_ACTIVATE] != NULL)
-    this->soundSource->play(this->soundBuffers[WA_ACTIVATE]);
-}
-
-
-/**
- * this deactivates the weapon
-*/
-void Weapon::deactivate()
-{
-  PRINTF(4)("Deactivating the Weapon %s\n", this->getName());
-
-  if (this->soundBuffers[WA_DEACTIVATE] != NULL)
-    this->soundSource->play(this->soundBuffers[WA_DEACTIVATE]);
-}
-
-void Weapon::fire()
-{
-  this->energyLoaded -= this->minCharge;
-
-  if (this->soundBuffers[WA_SHOOT] != NULL)
-    this->soundSource->play(this->soundBuffers[WA_SHOOT]);
-}
-
-void Weapon::reload()
+    this->stateDuration = this->times[WA_SHOOT] + this->stateDuration;
+    this->requestedAction = WA_NONE;
+  }
+  else  // reload if we still have the charge
+  {
+    this->requestedAction = WA_NONE;
+    this->requestAction(WA_RELOAD);
+  }
+}
+
+
+/**
+ *
+ * @return
+ */
+bool Weapon::reloadW()
 {
   PRINTF(4)("Reloading Weapon %s\n", this->getName());
-  if (this->energy + this->energyLoaded < this->minCharge)
+  if (unlikely(this->energy + this->energyLoaded < this->minCharge))
   {
     this->requestAction(WA_DEACTIVATE);
-    return;
+    return false;
   }
 
   float chargeSize = this->energyLoadedMax - this->energyLoaded;       //!< The energy to be charged
+
+  if (this->soundBuffers[WA_RELOAD] != NULL)
+    this->soundSource->play(this->soundBuffers[WA_RELOAD]);
 
   if (chargeSize > this->energy)
@@ -303,25 +334,10 @@
     this->energy -= chargeSize;
   }
-  if (this->soundBuffers[WA_RELOAD] != NULL)
-    this->soundSource->play(this->soundBuffers[WA_RELOAD]);
-
-}
-
-void Weapon::charge()
-{
-  if (this->soundBuffers[WA_CHARGE] != NULL)
-    this->soundSource->play(this->soundBuffers[WA_CHARGE]);
-
-}
-
-
-/**
- *  is called, when the weapon is destroyed
- *
- * this is in conjunction with the hit function, so when a weapon is able to get
- * hit, it can also be destoryed.
-*/
-void Weapon::destroy ()
-{}
+  this->reload();
+
+  this->requestedAction = WA_NONE;
+  this->stateDuration = this->times[WA_RELOAD] + this->stateDuration;
+
+}
 
 
Index: orxonox/trunk/src/world_entities/weapons/weapon.h
===================================================================
--- orxonox/trunk/src/world_entities/weapons/weapon.h	(revision 4891)
+++ orxonox/trunk/src/world_entities/weapons/weapon.h	(revision 4892)
@@ -19,5 +19,4 @@
 #define _WEAPON_H
 
-#include "base_object.h"
 #include "world_entity.h"
 
@@ -91,4 +90,8 @@
     Projectile* getProjectile() { return this->projectile; };
 
+    void setEmissionPoint(const Vector& point);
+    /** @see void setEmissionPoint(const Vector& point); */
+    inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x,y,z)); };
+
     /** @param state the State to time @param duration the duration of the State */
     inline void setStateDuration(const char* state, float duration) { setStateDuration(charToState(state), duration); };
@@ -101,4 +104,5 @@
     /** @returns the current State of the Weapon */
     inline WeaponState getCurrentState() const { return this->currentState; };
+
     /** @param energyMax the maximum energy the Weapon can have @param energyLoadedMax the maximum energy in the weapon buffers */
     inline void setMaximumEnergy(float energyMax, float energyLoadedMax = 0.0) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; };
@@ -108,5 +112,4 @@
     void setActionSound(const char* action, const char* soundFile) { this->setActionSound(charToAction(action), soundFile); };
 
-    virtual void destroy();
 
 
@@ -120,10 +123,10 @@
   protected:
     //! ACTION: these functions are handled by the Weapon itself, and must be called by requestAction(WeaponAction);
-    bool execute();
-    virtual void activate();
-    virtual void deactivate();
-    virtual void fire();
-    virtual void reload();
-    virtual void charge();
+    virtual void activate() {};
+    virtual void deactivate() {};
+    virtual void charge() {};
+    virtual void fire() {};
+    virtual void reload() {};
+    virtual void destroy() {};
 
 
@@ -136,4 +139,17 @@
 
   private:
+    /** executive functions, that handle timing with actions.
+     * This is for the action-functions in derived functions to be easy
+     * The main function is execute, that calls all the other functions
+     * for being fast, the Functions are private and as such will be inlined
+     * into the execute function. (this is work of the compiler)
+     */
+    bool execute();
+    bool activateW();
+    bool deactivateW();
+    bool chargeW();
+    bool fireW();
+    bool reloadW();
+
     bool nextActionValid() const;
 
@@ -161,4 +177,5 @@
     SoundBuffer*         soundBuffers[WA_ACTION_COUNT];    //!< SoundBuffers for all actions @see WeaponAction.
 
+    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
