Index: code/branches/weapons/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/weapons/src/orxonox/OrxonoxPrereqs.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/OrxonoxPrereqs.h	(revision 2912)
@@ -73,24 +73,4 @@
         };
     }
-
-    //put here all existing munitionTypes
-    namespace MunitionType
-    {
-        enum Enum
-        { laserGunMunition };
-    }
-
-    //put here all weapon fire modes.
-    //they have to be added to Pawn and HumanController, too.
-    namespace WeaponMode
-    {
-        enum Enum
-        {
-            fire     = 0x1,
-            altFire  = 0x2,
-            altFire2 = 0x4
-        };
-    }
-
 
     class GraphicsManager;
Index: code/branches/weapons/src/orxonox/objects/controllers/AIController.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/controllers/AIController.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/controllers/AIController.cc	(revision 2912)
@@ -111,5 +111,5 @@
 
         if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(500) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
-            this->getControllableEntity()->fire(WeaponMode::fire);
+            this->getControllableEntity()->fire(0);
 
         SUPER(AIController, tick, dt);
Index: code/branches/weapons/src/orxonox/objects/controllers/HumanController.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/controllers/HumanController.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/controllers/HumanController.cc	(revision 2912)
@@ -46,5 +46,4 @@
     SetConsoleCommand(HumanController, rotateRoll,    true).setAsInputCommand();
     SetConsoleCommand(HumanController, fire,          true).keybindMode(KeybindMode::OnHold);
-    SetConsoleCommand(HumanController, altFire,       true).keybindMode(KeybindMode::OnHold);
     SetConsoleCommand(HumanController, boost,         true).keybindMode(KeybindMode::OnHold);
     SetConsoleCommand(HumanController, greet,         true);
@@ -109,14 +108,8 @@
     }
 
-    void HumanController::fire()
+    void HumanController::fire(unsigned int firemode)
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
-            HumanController::localController_s->controllableEntity_->fire(WeaponMode::fire);
-    }
-
-    void HumanController::altFire()
-    {
-        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
-            HumanController::localController_s->controllableEntity_->fire(WeaponMode::altFire);
+            HumanController::localController_s->controllableEntity_->fire(firemode);
     }
 
Index: code/branches/weapons/src/orxonox/objects/controllers/HumanController.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/controllers/HumanController.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/controllers/HumanController.h	(revision 2912)
@@ -51,6 +51,5 @@
             static void rotateRoll(const Vector2& value);
 
-            static void fire();
-            static void altFire();
+            static void fire(unsigned int firemode);
 
             static void boost();
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/Munition.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/Munition.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/Munition.cc	(revision 2912)
@@ -28,10 +28,7 @@
 
 #include "OrxonoxStableHeaders.h"
+#include "Munition.h"
 
 #include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Debug.h"
-
-#include "Munition.h"
 
 namespace orxonox
@@ -42,8 +39,11 @@
     {
         RegisterObject(Munition);
+
+COUT(0) << "+Munition" << std::endl;
     }
 
     Munition::~Munition()
     {
+COUT(0) << "~Munition" << std::endl;
     }
 
@@ -112,9 +112,3 @@
         this->magazines_ = this->maxMagazines_;
     }
-
-    void Munition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(Munition, XMLPort, xmlelement, mode);
-    }
-
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/Munition.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/Munition.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/Munition.h	(revision 2912)
@@ -31,9 +31,5 @@
 
 #include "OrxonoxPrereqs.h"
-
 #include "core/BaseObject.h"
-
-#include "Weapon.h"
-
 
 namespace orxonox
@@ -44,6 +40,4 @@
             Munition(BaseObject* creator);
             virtual ~Munition();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
             void setMaxBullets(unsigned int amount);
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/Weapon.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2912)
@@ -28,10 +28,11 @@
 
 #include "OrxonoxStableHeaders.h"
+#include "Weapon.h"
 
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "util/Debug.h"
-
-#include "Weapon.h"
+
+#include "Munition.h"
+#include "WeaponSystem.h"
 
 namespace orxonox
@@ -45,5 +46,5 @@
         this->bulletReadyToShoot_ = true;
         this->magazineReadyToShoot_ = true;
-        this->parentWeaponSystem_ = 0;
+        this->weaponSystem_ = 0;
         this->attachedToWeaponSlot_ = 0;
         this->bulletLoadingTime_ = 0;
@@ -55,10 +56,12 @@
         this->unlimitedMunition_ = false;
         this->setObjectMode(0x0);
+
+COUT(0) << "+Weapon" << std::endl;
     }
 
     Weapon::~Weapon()
     {
-    }
-
+COUT(0) << "~Weapon" << std::endl;
+    }
 
     void Weapon::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -152,12 +155,12 @@
 
 
-    void Weapon::attachNeededMunition(std::string munitionName)
+    void Weapon::attachNeededMunition(const std::string& munitionName)
     {
         /*  if munition type already exists attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem
         */
-        if (this->parentWeaponSystem_)
+        if (this->weaponSystem_)
         {
             //getMunitionType returns 0 if there is no such munitionType
-            Munition* munition = this->parentWeaponSystem_->getMunitionType(munitionName);
+            Munition* munition = this->weaponSystem_->getMunitionType(munitionName);
             if ( munition )
             {
@@ -170,5 +173,5 @@
                 this->munitionIdentifier_ = ClassByString(munitionName);
                 this->munition_ = this->munitionIdentifier_.fabricate(this);
-                this->parentWeaponSystem_->setNewMunition(munitionName, this->munition_);
+                this->weaponSystem_->setNewMunition(munitionName, this->munition_);
                 this->setMunition();
             }
@@ -177,7 +180,7 @@
 
 
-    Munition * Weapon::getAttachedMunition(std::string munitionType)
-    {
-        this->munition_ = this->parentWeaponSystem_->getMunitionType(munitionType);
+    Munition * Weapon::getAttachedMunition(const std::string& munitionType)
+    {
+        this->munition_ = this->weaponSystem_->getMunitionType(munitionType);
         return this->munition_;
     }
@@ -193,8 +196,8 @@
 
     //get and set functions for XMLPort
-    void Weapon::setMunitionType(std::string munitionType)
+    void Weapon::setMunitionType(const std::string& munitionType)
     {   this->munitionType_ = munitionType; }
 
-    const std::string Weapon::getMunitionType()
+    const std::string& Weapon::getMunitionType() const
     {   return this->munitionType_;  }
 
@@ -202,5 +205,5 @@
     {   this->bulletLoadingTime_ = loadingTime; }
 
-    const float Weapon::getBulletLoadingTime()
+    const float Weapon::getBulletLoadingTime() const
     {   return this->bulletLoadingTime_;  }
 
@@ -208,5 +211,5 @@
     {   this->magazineLoadingTime_ = loadingTime; }
 
-    const float Weapon::getMagazineLoadingTime()
+    const float Weapon::getMagazineLoadingTime() const
     {   return this->magazineLoadingTime_;  }
 
@@ -214,5 +217,5 @@
     {   this->bulletAmount_ = amount; }
 
-    const unsigned int Weapon::getBulletAmount()
+    const unsigned int Weapon::getBulletAmount() const
     {   return this->bulletAmount_;  }
 
@@ -220,5 +223,5 @@
     {   this->magazineAmount_ = amount; }
 
-    const unsigned int Weapon::getMagazineAmount()
+    const unsigned int Weapon::getMagazineAmount() const
     {   return this->magazineAmount_;   }
 
@@ -226,5 +229,5 @@
     {   this->unlimitedMunition_ = unlimitedMunition;   }
 
-    const bool Weapon::getUnlimitedMunition()
+    const bool Weapon::getUnlimitedMunition() const
     {   return this->unlimitedMunition_;    }
 
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/Weapon.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/Weapon.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/Weapon.h	(revision 2912)
@@ -31,14 +31,8 @@
 
 #include "OrxonoxPrereqs.h"
+#include "objects/worldentities/StaticEntity.h"
 
-#include "core/BaseObject.h"
-#include "tools/BillboardSet.h"
 #include "tools/Timer.h"
 #include "core/Identifier.h"
-
-#include "WeaponSystem.h"
-#include "Munition.h"
-
-#include "objects/worldentities/StaticEntity.h"
 
 namespace orxonox
@@ -53,6 +47,6 @@
 
             virtual void fire();
-            void attachNeededMunition(std::string munitionType);
-            Munition * getAttachedMunition(std::string munitiontype);
+            void attachNeededMunition(const std::string& munitionType);
+            Munition * getAttachedMunition(const std::string& munitiontype);
 
             //reloading
@@ -63,16 +57,16 @@
 
             //XMLPort functions
-            virtual void setMunitionType(std::string munitionType);
-            virtual const std::string getMunitionType();
+            virtual void setMunitionType(const std::string& munitionType);
+            virtual const std::string& getMunitionType() const;
             virtual void setBulletLoadingTime(float loadingTime);
-            virtual const float getBulletLoadingTime();
+            virtual const float getBulletLoadingTime() const;
             virtual void setMagazineLoadingTime(float loadingTime);
-            virtual const float getMagazineLoadingTime();
+            virtual const float getMagazineLoadingTime() const;
             virtual void setBulletAmount(unsigned int amount);
-            virtual const unsigned int getBulletAmount();
+            virtual const unsigned int getBulletAmount() const;
             virtual void setMagazineAmount(unsigned int amount);
-            virtual const unsigned int getMagazineAmount();
+            virtual const unsigned int getMagazineAmount() const;
             virtual void setUnlimitedMunition(bool unlimitedMunition);
-            virtual const bool getUnlimitedMunition();
+            virtual const bool getUnlimitedMunition() const;
 
             //weapon actions
@@ -86,17 +80,14 @@
             virtual void setWeapon();
             virtual void setMunition();
-            
-            inline void setParentWeaponSystem(WeaponSystem *parentWeaponSystem)
-                { this->parentWeaponSystem_=parentWeaponSystem; };
-            inline WeaponSystem * getParentWeaponSystem()
-                { return this->parentWeaponSystem_; };
+
+            inline void setWeaponSystem(WeaponSystem *weaponSystem)
+                { this->weaponSystem_ = weaponSystem; };
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; };
 
             inline void setAttachedToWeaponSlot(WeaponSlot * wSlot)
                 { this->attachedToWeaponSlot_ = wSlot; }
-            inline WeaponSlot * getAttachedToWeaponSlot()
+            inline WeaponSlot * getAttachedToWeaponSlot() const
                 { return this->attachedToWeaponSlot_; }
-
-
-        private:
 
         protected:
@@ -113,5 +104,5 @@
             WeaponSlot * attachedToWeaponSlot_;
             Munition * munition_;
-            WeaponSystem * parentWeaponSystem_;
+            WeaponSystem * weaponSystem_;
 
             SubclassIdentifier<Munition> munitionIdentifier_;
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponPack.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponPack.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponPack.cc	(revision 2912)
@@ -27,13 +27,12 @@
 
 #include "OrxonoxStableHeaders.h"
-
-#include <vector>
+#include "WeaponPack.h"
 
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "util/Debug.h"
+#include "objects/worldentities/pawns/Pawn.h"
 
-#include "WeaponPack.h"
-#include "objects/worldentities/pawns/Pawn.h"
+#include "Weapon.h"
+#include "WeaponSlot.h"
 
 namespace orxonox
@@ -45,14 +44,24 @@
         RegisterObject(WeaponPack);
 
-        this->parentWeaponSystem_ = 0;
+        this->weaponSystem_ = 0;
         this->firemode_ = 0;
 
+COUT(0) << "+WeaponPack" << std::endl;
     }
 
     WeaponPack::~WeaponPack()
     {
+COUT(0) << "~WeaponPack" << std::endl;
     }
 
-    int WeaponPack::getSize()
+    void WeaponPack::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponPack, XMLPort, xmlelement, mode);
+
+        XMLPortObject(WeaponPack, Weapon, "", addWeapon, getWeapon, xmlelement, mode);
+        XMLPortParam(WeaponPack, "firemode", setFireMode, getFireMode, xmlelement, mode);
+    }
+
+    int WeaponPack::getSize() const
     {
         return this->weapons_.size();
@@ -67,15 +76,7 @@
     }
 
-    Weapon * WeaponPack::getWeaponPointer(unsigned int n)
+    Weapon * WeaponPack::getWeaponPointer(unsigned int n) const
     {
         return this->weapons_[n];
-    }
-
-    void WeaponPack::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(WeaponPack, XMLPort, xmlelement, mode);
-
-        XMLPortObject(WeaponPack, Weapon, "", addWeapon, getWeapon, xmlelement, mode);
-        XMLPortParam(WeaponPack, "firemode", setFireMode, getFireMode, xmlelement, mode);
     }
 
@@ -85,5 +86,5 @@
     }
 
-    unsigned int WeaponPack::getFireMode()
+    unsigned int WeaponPack::getFireMode() const
     {
         return this->firemode_;
@@ -95,27 +96,22 @@
     }
 
-    const Weapon * WeaponPack::getWeapon(unsigned int index)
+    const Weapon * WeaponPack::getWeapon(unsigned int index) const
     {
         return weapons_[index];
     }
 
-    void WeaponPack::setParentWeaponSystemToAllWeapons(WeaponSystem * weaponSystem)
+    void WeaponPack::setWeaponSystemToAllWeapons(WeaponSystem * weaponSystem)
     {
-        for (int i=0; i < (int) this->weapons_.size(); i++)
-        {
-            this->weapons_[i]->setParentWeaponSystem(weaponSystem);
-        }
-
+        for (size_t i = 0; i < this->weapons_.size(); i++)
+            this->weapons_[i]->setWeaponSystem(weaponSystem);
     }
 
     void WeaponPack::attachNeededMunitionToAllWeapons()
     {
-        for (int i=0; i < (int) this->weapons_.size(); i++)
+        for (size_t i = 0; i < this->weapons_.size(); i++)
         {
             this->weapons_[i]->attachNeededMunition(weapons_[i]->getMunitionType());
             this->weapons_[i]->setWeapon();
         }
-
     }
-
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponPack.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponPack.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponPack.h	(revision 2912)
@@ -33,8 +33,7 @@
 #include "OrxonoxPrereqs.h"
 
+#include <vector>
+
 #include "core/BaseObject.h"
-
-#include "Weapon.h"
-
 
 namespace orxonox
@@ -50,26 +49,27 @@
             void fire();
 
-            Weapon * getWeaponPointer(unsigned int n);
-            int getSize();
+            Weapon * getWeaponPointer(unsigned int n) const;
+            int getSize() const;
 
             void setFireMode(unsigned int firemode);
-            unsigned int getFireMode();
+            unsigned int getFireMode() const;
 
             void addWeapon(Weapon * weapon);
-            const Weapon * getWeapon(unsigned int index);
+            const Weapon * getWeapon(unsigned int index) const;
+
+            void attachNeededMunitionToAllWeapons();
 
             //functions with effect to all weapons of the weaponPack
             //functions needed for creating Pointer to the right objects (-->Pawn.cc)
-            void setParentWeaponSystemToAllWeapons(WeaponSystem * weaponSystem);
-            void attachNeededMunitionToAllWeapons();
-
-            inline void setParentWeaponSystem(WeaponSystem *parentWeaponSystem)
-                { parentWeaponSystem_=parentWeaponSystem; }
-            inline WeaponSystem * getParentWeaponSystem()
-                { return parentWeaponSystem_; }
+            inline void setWeaponSystem(WeaponSystem *weaponSystem)
+                { this->weaponSystem_ = weaponSystem; this->setWeaponSystemToAllWeapons(weaponSystem); }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
 
         private:
+            void setWeaponSystemToAllWeapons(WeaponSystem * weaponSystem);
+
             std::vector<Weapon *> weapons_;
-            WeaponSystem *parentWeaponSystem_;
+            WeaponSystem *weaponSystem_;
             unsigned int firemode_;
     };
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSet.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSet.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSet.cc	(revision 2912)
@@ -27,14 +27,14 @@
 
 #include "OrxonoxStableHeaders.h"
-
-#include <vector>
+#include "WeaponSet.h"
 
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "util/Debug.h"
 #include "objects/worldentities/pawns/Pawn.h"
 
-#include "WeaponSet.h"
+#include "Weapon.h"
+#include "WeaponSlot.h"
 #include "WeaponPack.h"
+#include "WeaponSystem.h"
 
 namespace orxonox
@@ -46,19 +46,29 @@
         RegisterObject(WeaponSet);
 
-        this->parentWeaponSystem_ = 0;
+        this->weaponSystem_ = 0;
         this->attachedWeaponPack_ = 0;
+
+COUT(0) << "+WeaponSet" << std::endl;
     }
 
     WeaponSet::~WeaponSet()
     {
+COUT(0) << "~WeaponSet" << std::endl;
+    }
+
+    void WeaponSet::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponSet, XMLPort, xmlelement, mode);
+
+        XMLPortParam(WeaponSet, "firemode", setFireMode, getFireMode, xmlelement, mode);
     }
 
     void WeaponSet::attachWeaponPack(WeaponPack *wPack)
     {
-        if ( this->parentWeaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->parentWeaponSystem_->getWeaponSlotSize() ) )
+        if ( this->weaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->weaponSystem_->getWeaponSlotSize() ) )
         {
             this->attachedWeaponPack_ = wPack;
             int wPackWeapon = 0;    //WeaponCounter for Attaching
-           
+
             //should be possible to choose which slot to use
             //attach every weapon of the weaponPack to a weaponSlot
@@ -67,20 +77,20 @@
                 //at the moment this function only works for one weaponPack in the entire WeaponSystem...
                 //it also takes the first free weaponSlot...
-                if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() == 0 && this->parentWeaponSystem_->getWeaponSlotPointer(i) != 0) //if slot not full
+                if ( this->weaponSystem_->getWeaponSlot(i)->getAttachedWeapon() == 0 && this->weaponSystem_->getWeaponSlot(i) != 0) //if slot not full
                 {
-                    this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) );
-                    this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
-                    this->parentWeaponSystem_->getParentPawn()->attach( wPack->getWeaponPointer(wPackWeapon) );
+                    this->setWeaponSlots_.push_back( this->weaponSystem_->getWeaponSlot(i) );
+                    this->weaponSystem_->getWeaponSlot(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
+                    this->weaponSystem_->getPawn()->attach( wPack->getWeaponPointer(wPackWeapon) );
                     wPackWeapon++;
                 }
                 else
                 {
-                    for (int k=0; k < this->parentWeaponSystem_->getWeaponSlotSize(); k++)
+                    for (int k=0; k < this->weaponSystem_->getWeaponSlotSize(); k++)
                     {
-                        if ( this->parentWeaponSystem_->getWeaponSlotPointer(k)->getAttachedWeapon() == 0 )
+                        if ( this->weaponSystem_->getWeaponSlot(k)->getAttachedWeapon() == 0 )
                         {
-                            this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(k) );
-                            this->parentWeaponSystem_->getWeaponSlotPointer(k)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
-                            this->parentWeaponSystem_->getParentPawn()->attach( wPack->getWeaponPointer(wPackWeapon) );
+                            this->setWeaponSlots_.push_back( this->weaponSystem_->getWeaponSlot(k) );
+                            this->weaponSystem_->getWeaponSlot(k)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
+                            this->weaponSystem_->getPawn()->attach( wPack->getWeaponPointer(wPackWeapon) );
                             wPackWeapon++;
                         }
@@ -98,16 +108,3 @@
             this->attachedWeaponPack_->fire();
     }
-
-    void WeaponSet::setFireMode(const unsigned int firemode)
-    {   this->firemode_ = firemode; }
-
-    const unsigned int WeaponSet::getFireMode() const
-    {   return this->firemode_; }
-
-    void WeaponSet::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(WeaponSet, XMLPort, xmlelement, mode);
-        XMLPortParam(WeaponSet, "firemode", setFireMode, getFireMode, xmlelement, mode);
-    }
-
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSet.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSet.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSet.h	(revision 2912)
@@ -33,8 +33,7 @@
 #include "OrxonoxPrereqs.h"
 
+#include <vector>
+
 #include "core/BaseObject.h"
-
-#include "WeaponSlot.h"
-
 
 namespace orxonox
@@ -51,14 +50,16 @@
             void fire();
 
-            void setFireMode(const unsigned int firemode);
-            const unsigned int getFireMode() const;
+            inline void setFireMode(const unsigned int firemode)
+                { this->firemode_ = firemode; }
+            inline unsigned int getFireMode() const
+                { return this->firemode_; }
 
-            inline void setParentWeaponSystem(WeaponSystem *parentWeaponSystem)
-                { parentWeaponSystem_=parentWeaponSystem; }
-            inline WeaponSystem * getParentWeaponSystem()
-                { return parentWeaponSystem_; }
+            inline void setWeaponSystem(WeaponSystem *weaponSystem)
+                { this->weaponSystem_ = weaponSystem; }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
 
         private:
-            WeaponSystem *parentWeaponSystem_;
+            WeaponSystem *weaponSystem_;
             std::vector<WeaponSlot *> setWeaponSlots_;
             unsigned int firemode_;
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSlot.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSlot.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSlot.cc	(revision 2912)
@@ -28,11 +28,10 @@
 
 #include "OrxonoxStableHeaders.h"
+#include "WeaponSlot.h"
 
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "util/Debug.h"
 
-#include "WeaponSlot.h"
-
+#include "Weapon.h"
 
 namespace orxonox
@@ -47,10 +46,17 @@
         this->attachedWeapon_ = 0;
         this->setObjectMode(0x0);
+
+COUT(0) << "+WeaponSlot" << std::endl;
     }
 
     WeaponSlot::~WeaponSlot()
     {
+COUT(0) << "~WeaponSlot" << std::endl;
     }
 
+    void WeaponSlot::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponSlot, XMLPort, xmlelement, mode);
+    }
 
     /*sets the munition type
@@ -71,10 +77,4 @@
     }
 
-
-    void WeaponSlot::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(WeaponSlot, XMLPort, xmlelement, mode);
-    }
-
     void WeaponSlot::attachWeapon(Weapon *weapon)
     {
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSlot.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSlot.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSlot.h	(revision 2912)
@@ -31,6 +31,4 @@
 
 #include "OrxonoxPrereqs.h"
-
-#include "Weapon.h"
 #include "objects/worldentities/StaticEntity.h"
 
@@ -50,8 +48,8 @@
             void fire();
 
-            inline void setParentWeaponSystem(WeaponSystem *parentWeaponSystem)
-                { parentWeaponSystem_=parentWeaponSystem; }
-            inline WeaponSystem * getParentWeaponSystem()
-                { return parentWeaponSystem_; }
+            inline void setWeaponSystem(WeaponSystem *weaponSystem)
+                { this->weaponSystem_ = weaponSystem; }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
 
 
@@ -60,5 +58,5 @@
             bool unlimitedAmmo_;
 
-            WeaponSystem *parentWeaponSystem_;
+            WeaponSystem *weaponSystem_;
     };
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSystem.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSystem.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSystem.cc	(revision 2912)
@@ -28,13 +28,12 @@
 
 #include "OrxonoxStableHeaders.h"
-
-#include <vector>
+#include "WeaponSystem.h"
 
 #include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Debug.h"
+#include "objects/worldentities/pawns/Pawn.h"
 
-#include "WeaponSystem.h"
-
+#include "WeaponSlot.h"
+#include "WeaponPack.h"
+#include "WeaponSet.h"
 
 /* WeaponSystem
@@ -51,31 +50,87 @@
         RegisterObject(WeaponSystem);
 
-        this->parentPawn_ = 0;
+        this->pawn_ = 0;
+COUT(0) << "+WeaponSystem" << std::endl;
     }
 
     WeaponSystem::~WeaponSystem()
     {
+COUT(0) << "~WeaponSystem" << std::endl;
+        if (this->isInitialized())
+        {
+            if (this->pawn_)
+                this->pawn_->setWeaponSystem(0);
+        }
     }
 
-    void WeaponSystem::attachWeaponPack(WeaponPack *wPack, unsigned int firemode)
+    void WeaponSystem::attachWeaponSet(WeaponSet *wSet)
     {
-        if (firemode < this->weaponSets_.size())
-            this->weaponSets_[firemode]->attachWeaponPack(wPack);
-        this->weaponPacks_.push_back(wPack);
+        if (!wSet)
+            return;
+
+        this->weaponSets_[wSet->getFireMode()] = wSet;
+        wSet->setWeaponSystem(this);
+    }
+
+    WeaponSet * WeaponSystem::getWeaponSet(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::map<unsigned int, WeaponSet*>::const_iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return it->second;
+        }
+        return 0;
     }
 
     void WeaponSystem::attachWeaponSlot(WeaponSlot *wSlot)
     {
-        wSlot->setParentWeaponSystem(this);
-        this->weaponSlots_.push_back(wSlot);
+        if (!wSlot)
+            return;
+
+        this->weaponSlots_.insert(wSlot);
+        wSlot->setWeaponSystem(this);
     }
 
-    void WeaponSystem::attachWeaponSet(WeaponSet *wSet)
+    WeaponSlot * WeaponSystem::getWeaponSlot(unsigned int index) const
     {
-        wSet->setParentWeaponSystem(this);
-        this->weaponSets_.push_back(wSet);
+        unsigned int i = 0;
+        for (std::set<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return (*it);
+        }
+        return 0;
     }
 
-    void WeaponSystem::setNewMunition(std::string munitionType, Munition * munitionToAdd)
+    void WeaponSystem::attachWeaponPack(WeaponPack *wPack, unsigned int wSetNumber)
+    {
+        if (!wPack)
+            return;
+
+        std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(wSetNumber);
+        if (it != this->weaponSets_.end() && it->second)
+            it->second->attachWeaponPack(wPack);
+
+        this->weaponPacks_.insert(wPack);
+        wPack->setWeaponSystem(this);
+        wPack->attachNeededMunitionToAllWeapons(); // TODO - what is this?
+    }
+
+    WeaponPack * WeaponSystem::getWeaponPack(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::set<WeaponPack*>::iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return (*it);
+        }
+        return 0;
+   }
+
+    void WeaponSystem::setNewMunition(const std::string& munitionType, Munition * munitionToAdd)
     {
         this->munitionSet_[munitionType] = munitionToAdd;
@@ -84,5 +139,5 @@
 
     //returns the Pointer to the munitionType, if this munitionType doesn't exist returns 0, see Weapon::attachNeededMunition
-    Munition * WeaponSystem::getMunitionType(std::string munitionType)
+    Munition * WeaponSystem::getMunitionType(const std::string& munitionType) const
     {
         std::map<std::string, Munition *>::const_iterator it = this->munitionSet_.find(munitionType);
@@ -97,52 +152,9 @@
     //SpaceShip.cc only needs to have the keybinding to a specific Set-number n (=firemode)
     //in future this could be well defined and not only for 3 different WeaponModes
-    void WeaponSystem::fire(WeaponMode::Enum n)
+    void WeaponSystem::fire(unsigned int firemode)
     {
-        int set = 0;
-        switch (n)
-        {
-            case WeaponMode::fire:
-                set = 0;
-                break;
-            case WeaponMode::altFire:
-                set = 1;
-                break;
-            case WeaponMode::altFire2:
-                set = 2;
-                break;
-        }
-        if (set < (int)this->weaponSets_.size())
-            this->weaponSets_[set]->fire();
+        std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode);
+        if (it != this->weaponSets_.end() && it->second)
+            it->second->fire();
     }
-
-
-    WeaponSet * WeaponSystem::getWeaponSetPointer(unsigned int n)
-    {
-        if (n < this->weaponSets_.size())
-            return this->weaponSets_[n];
-        else
-            return 0;
-    }
-
-    WeaponSlot * WeaponSystem::getWeaponSlotPointer(unsigned int n)
-    {
-        if (n < this->weaponSlots_.size())
-            return this->weaponSlots_[n];
-        else
-            return 0;
-    }
-
-    WeaponPack * WeaponSystem::getWeaponPackPointer(unsigned int n)
-    {
-        if (n < this->weaponPacks_.size())
-            return this->weaponPacks_[n];
-        else
-            return 0;
-    }
-
-    void WeaponSystem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(WeaponSystem, XMLPort, xmlelement, mode);
-    }
-
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSystem.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSystem.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSystem.h	(revision 2912)
@@ -33,11 +33,12 @@
 #include "OrxonoxPrereqs.h"
 
+#include <set>
+#include <map>
+
 #include "core/BaseObject.h"
-
-#include "WeaponSet.h"
-#include "WeaponPack.h"
 
 namespace orxonox
 {
+    const unsigned int MAX_FIRE_MODES = 8;
 
     class _OrxonoxExport WeaponSystem : public BaseObject
@@ -47,32 +48,38 @@
             virtual ~WeaponSystem();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void attachWeaponSlot(WeaponSlot * wSlot);
+            WeaponSlot * getWeaponSlot(unsigned int index) const;
 
-            void attachWeaponSlot(WeaponSlot *wSlot);
-            void attachWeaponSet(WeaponSet *wSet);
-            //void fire();
-            void fire(WeaponMode::Enum fireMode);
-            void attachWeaponPack(WeaponPack * wPack, unsigned int firemode);
-            WeaponSet * getWeaponSetPointer(unsigned int n);
-            WeaponSlot * getWeaponSlotPointer(unsigned int n);
-            WeaponPack * getWeaponPackPointer(unsigned int n);
-            void setNewMunition(std::string munitionType, Munition * munitionToAdd);
-            void setNewSharedMunition(std::string munitionType, Munition * munitionToAdd);
-            Munition * getMunitionType(std::string munitionType);
+            void attachWeaponSet(WeaponSet * wSet);
+            WeaponSet * getWeaponSet(unsigned int index) const;
 
-            inline void setParentPawn(Pawn *parentPawn)
-                { parentPawn_=parentPawn; }
-            inline Pawn * getParentPawn()
-                { return parentPawn_; }
+            void attachWeaponPack(WeaponPack * wPack, unsigned int wSetNumber);
+            WeaponPack * getWeaponPack(unsigned int index) const;
 
-            inline int getWeaponSlotSize()
+            void fire(unsigned int firemode);
+
+            void setNewMunition(const std::string& munitionType, Munition * munitionToAdd);
+            void setNewSharedMunition(const std::string& munitionType, Munition * munitionToAdd);
+            Munition * getMunitionType(const std::string& munitionType) const;
+
+            inline void setPawn(Pawn * pawn)
+                { this->pawn_ = pawn; }
+            inline Pawn * getPawn() const
+                { return this->pawn_; }
+
+            inline int getWeaponSlotSize() const
                 { return this->weaponSlots_.size(); }
 
+            static inline unsigned int getMaxFireModes()
+                { return MAX_FIRE_MODES; }
+            static inline unsigned int getFireModeMask(unsigned int firemode)
+                { return (0x1 << firemode); }
+
         private:
-            std::vector<WeaponSet *> weaponSets_;
-            std::vector<WeaponSlot *> weaponSlots_;
-            std::vector<WeaponPack *> weaponPacks_;
+            std::map<unsigned int, WeaponSet *> weaponSets_;
+            std::set<WeaponSlot *> weaponSlots_;
+            std::set<WeaponPack *> weaponPacks_;
             std::map<std::string, Munition *> munitionSet_;
-            Pawn *parentPawn_;
+            Pawn * pawn_;
     };
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/FusionMunition.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/FusionMunition.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/FusionMunition.cc	(revision 2912)
@@ -28,10 +28,7 @@
 
 #include "OrxonoxStableHeaders.h"
+#include "FusionMunition.h"
 
 #include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Debug.h"
-
-#include "FusionMunition.h"
 
 namespace orxonox
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/FusionMunition.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/FusionMunition.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/FusionMunition.h	(revision 2912)
@@ -31,7 +31,5 @@
 
 #include "OrxonoxPrereqs.h"
-
-#include "core/BaseObject.h"
-#include "../Munition.h"
+#include "objects/weaponSystem/Munition.h"
 
 namespace orxonox
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.cc	(revision 2912)
@@ -28,10 +28,7 @@
 
 #include "OrxonoxStableHeaders.h"
+#include "LaserGunMunition.h"
 
 #include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Debug.h"
-
-#include "LaserGunMunition.h"
 
 namespace orxonox
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.h	(revision 2912)
@@ -31,7 +31,5 @@
 
 #include "OrxonoxPrereqs.h"
-
-#include "core/BaseObject.h"
-#include "../Munition.h"
+#include "objects/weaponSystem/Munition.h"
 
 namespace orxonox
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Fusion.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Fusion.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Fusion.cc	(revision 2912)
@@ -28,12 +28,11 @@
 
 #include "OrxonoxStableHeaders.h"
-
+#include "Fusion.h"
 
 #include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Debug.h"
 
-#include "Fusion.h"
-
+#include "objects/weaponSystem/Munition.h"
+#include "objects/weaponSystem/projectiles/ParticleProjectile.h"
+#include "objects/weaponSystem/WeaponSystem.h"
 
 namespace orxonox
@@ -73,5 +72,5 @@
         projectile->setPosition(this->getWorldPosition());
         projectile->setVelocity(this->getWorldOrientation() * WorldEntity::FRONT * this->speed_);
-        projectile->setOwner(this->getParentWeaponSystem()->getParentPawn());
+        projectile->setOwner(this->getWeaponSystem()->getPawn());
     }
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Fusion.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Fusion.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Fusion.h	(revision 2912)
@@ -31,12 +31,5 @@
 
 #include "OrxonoxPrereqs.h"
-
-#include "core/BaseObject.h"
-
-#include "../munitions/LaserGunMunition.h"
-#include "util/Math.h"
-#include "../Weapon.h"
-#include "../projectiles/BillboardProjectile.h"
-#include "../projectiles/ParticleProjectile.h"
+#include "objects/weaponSystem/Weapon.h"
 
 namespace orxonox
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/HsW01.cc	(revision 2912)
@@ -28,12 +28,8 @@
 
 #include "OrxonoxStableHeaders.h"
-
+#include "HsW01.h"
 
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "util/Debug.h"
-
-#include "HsW01.h"
-
 
 namespace orxonox
@@ -79,5 +75,5 @@
         projectile->setPosition(this->getWorldPosition());
         projectile->setVelocity(this->getWorldOrientation() * WorldEntity::FRONT * this->speed_);
-        projectile->setOwner(this->getParentWeaponSystem()->getParentPawn());
+        projectile->setOwner(this->getWeaponSystem()->getPawn());
     }
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc	(revision 2912)
@@ -28,12 +28,11 @@
 
 #include "OrxonoxStableHeaders.h"
-
+#include "LaserGun.h"
 
 #include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Debug.h"
 
-#include "LaserGun.h"
-
+#include "objects/weaponSystem/Munition.h"
+#include "objects/weaponSystem/projectiles/ParticleProjectile.h"
+#include "objects/weaponSystem/WeaponSystem.h"
 
 namespace orxonox
@@ -79,5 +78,5 @@
         projectile->setPosition(this->getWorldPosition());
         projectile->setVelocity(this->getWorldOrientation() * WorldEntity::FRONT * this->speed_);
-        projectile->setOwner(this->getParentWeaponSystem()->getParentPawn());
+        projectile->setOwner(this->getWeaponSystem()->getPawn());
     }
 }
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/LaserGun.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/LaserGun.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/LaserGun.h	(revision 2912)
@@ -31,12 +31,5 @@
 
 #include "OrxonoxPrereqs.h"
-
-#include "core/BaseObject.h"
-
-#include "../munitions/LaserGunMunition.h"
-#include "util/Math.h"
-#include "../Weapon.h"
-#include "../projectiles/BillboardProjectile.h"
-#include "../projectiles/ParticleProjectile.h"
+#include "objects/weaponSystem/Weapon.h"
 
 namespace orxonox
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Missile.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Missile.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Missile.cc	(revision 2912)
@@ -28,11 +28,8 @@
 
 #include "OrxonoxStableHeaders.h"
-
-#include <list>
+#include "Missile.h"
 
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "util/Debug.h"
-
 
 namespace orxonox
Index: code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Missile.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Missile.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/weaponSystem/weapons/Missile.h	(revision 2912)
@@ -31,7 +31,5 @@
 
 #include "OrxonoxPrereqs.h"
-
 #include "objects/weaponSystem/Weapon.h"
-
 
 namespace orxonox
Index: code/branches/weapons/src/orxonox/objects/worldentities/ControllableEntity.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2912)
@@ -31,7 +31,5 @@
 
 #include "OrxonoxPrereqs.h"
-
 #include "MobileEntity.h"
-#include "objects/weaponSystem/WeaponSystem.h"
 
 namespace orxonox
@@ -83,6 +81,5 @@
                 { this->rotateRoll(Vector2(value, 0)); }
 
-            virtual void fire(WeaponMode::Enum fireMode) {}
-            virtual void altFire(WeaponMode::Enum fireMode) {}
+            virtual void fire(unsigned int firemode) {}
 
             virtual void boost() {}
Index: code/branches/weapons/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2912)
@@ -39,4 +39,8 @@
 #include "objects/worldentities/ParticleSpawner.h"
 #include "objects/worldentities/ExplosionChunk.h"
+#include "objects/weaponSystem/WeaponSystem.h"
+#include "objects/weaponSystem/WeaponSlot.h"
+#include "objects/weaponSystem/WeaponPack.h"
+#include "objects/weaponSystem/WeaponSet.h"
 
 namespace orxonox
@@ -66,5 +70,5 @@
         {
             this->weaponSystem_ = new WeaponSystem(this);
-            this->weaponSystem_->setParentPawn(this);
+            this->weaponSystem_->setPawn(this);
         }
         else
@@ -100,7 +104,7 @@
         XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7);
 
-        XMLPortObject(Pawn, WeaponSlot, "weaponslots", setWeaponSlot, getWeaponSlot, xmlelement, mode);
-        XMLPortObject(Pawn, WeaponSet, "weaponsets", setWeaponSet, getWeaponSet, xmlelement, mode);
-        XMLPortObject(Pawn, WeaponPack, "weapons", setWeaponPack, getWeaponPack, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPack, getWeaponPack, xmlelement, mode);
     }
 
@@ -119,10 +123,7 @@
         if (this->weaponSystem_)
         {
-            if (this->fire_ & WeaponMode::fire)
-                this->weaponSystem_->fire(WeaponMode::fire);
-            if (this->fire_ & WeaponMode::altFire)
-                this->weaponSystem_->fire(WeaponMode::altFire);
-            if (this->fire_ & WeaponMode::altFire2)
-                this->weaponSystem_->fire(WeaponMode::altFire2);
+            for (unsigned int firemode = 0; firemode < WeaponSystem::getMaxFireModes(); firemode++)
+                if (this->fire_ & WeaponSystem::getFireModeMask(firemode))
+                    this->weaponSystem_->fire(firemode);
         }
         this->fire_ = this->firehack_;
@@ -252,7 +253,7 @@
     }
 
-    void Pawn::fire(WeaponMode::Enum fireMode)
-    {
-        this->firehack_ |= fireMode;
+    void Pawn::fire(unsigned int firemode)
+    {
+        this->firehack_ |= WeaponSystem::getFireModeMask(firemode);
     }
 
@@ -275,5 +276,5 @@
     *       --> e.g. Pickup-Items
     */
-    void Pawn::setWeaponSlot(WeaponSlot * wSlot)
+    void Pawn::addWeaponSlot(WeaponSlot * wSlot)
     {
         this->attach(wSlot);
@@ -285,18 +286,13 @@
     {
         if (this->weaponSystem_)
-            return this->weaponSystem_->getWeaponSlotPointer(index);
+            return this->weaponSystem_->getWeaponSlot(index);
         else
             return 0;
     }
 
-    void Pawn::setWeaponPack(WeaponPack * wPack)
-    {
-        if (this->weaponSystem_)
-        {
-            wPack->setParentWeaponSystem(this->weaponSystem_);
-            wPack->setParentWeaponSystemToAllWeapons(this->weaponSystem_);
-            this->weaponSystem_->attachWeaponPack( wPack,wPack->getFireMode() );
-            wPack->attachNeededMunitionToAllWeapons();
-        }
+    void Pawn::addWeaponPack(WeaponPack * wPack)
+    {
+        if (this->weaponSystem_)
+            this->weaponSystem_->attachWeaponPack(wPack, wPack->getFireMode());
     }
 
@@ -304,10 +300,10 @@
     {
         if (this->weaponSystem_)
-            return this->weaponSystem_->getWeaponPackPointer(firemode);
+            return this->weaponSystem_->getWeaponPack(firemode);
         else
             return 0;
     }
 
-    void Pawn::setWeaponSet(WeaponSet * wSet)
+    void Pawn::addWeaponSet(WeaponSet * wSet)
     {
         if (this->weaponSystem_)
@@ -318,5 +314,5 @@
     {
         if (this->weaponSystem_)
-            return this->weaponSystem_->getWeaponSetPointer(index);
+            return this->weaponSystem_->getWeaponSet(index);
         else
             return 0;
Index: code/branches/weapons/src/orxonox/objects/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2912)
@@ -34,5 +34,4 @@
 #include "objects/worldentities/ControllableEntity.h"
 #include "objects/RadarViewable.h"
-#include "objects/weaponSystem/WeaponSystem.h"
 
 namespace orxonox
@@ -40,4 +39,6 @@
     class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable
     {
+        friend class WeaponSystem;
+
         public:
             Pawn(BaseObject* creator);
@@ -79,12 +80,12 @@
             virtual void kill();
 
-            virtual void fire(WeaponMode::Enum fireMode);
+            virtual void fire(unsigned int firemode);
             virtual void postSpawn();
 
-            void setWeaponSlot(WeaponSlot * wSlot);
+            void addWeaponSlot(WeaponSlot * wSlot);
             WeaponSlot * getWeaponSlot(unsigned int index) const;
-            void setWeaponPack(WeaponPack * wPack);
+            void addWeaponPack(WeaponPack * wPack);
             WeaponPack * getWeaponPack(unsigned int firemode) const;
-            void setWeaponSet(WeaponSet * wSet);
+            void addWeaponSet(WeaponSet * wSet);
             WeaponSet * getWeaponSet(unsigned int index) const;
 
@@ -134,4 +135,8 @@
             float spawnparticleduration_;
             unsigned int numexplosionchunks_;
+
+        private:
+            inline void setWeaponSystem(WeaponSystem* weaponsystem)
+                { this->weaponSystem_ = weaponsystem; }
     };
 
Index: code/branches/weapons/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2912)
@@ -196,5 +196,5 @@
     }
 
-    void Spectator::fire(WeaponMode::Enum fireMode)
+    void Spectator::fire(unsigned int firemode)
     {
         if (this->getPlayer())
Index: code/branches/weapons/src/orxonox/objects/worldentities/pawns/Spectator.h
===================================================================
--- code/branches/weapons/src/orxonox/objects/worldentities/pawns/Spectator.h	(revision 2911)
+++ code/branches/weapons/src/orxonox/objects/worldentities/pawns/Spectator.h	(revision 2912)
@@ -57,5 +57,5 @@
             virtual void rotateRoll(const Vector2& value);
 
-            virtual void fire(WeaponMode::Enum fireMode);
+            virtual void fire(unsigned int firemode);
             virtual void greet();
 
