Index: code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeapon.cc
===================================================================
--- code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeapon.cc	(revision 11058)
+++ code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeapon.cc	(revision 11059)
@@ -44,5 +44,4 @@
         weaponModeHUDActualSize_ = Vector2(0.0f,0.0f);
 
-        weaponModes_ = NULL;
         weaponIndex_ = 0;
         hudWeaponModes_.clear();
@@ -148,6 +147,4 @@
         destroyHUDChilds();
 
-        weaponModes_ = weapon_->getAllWeaponmodes();
-
         updateSize();
         createHUDChilds();
@@ -157,5 +154,5 @@
     void HUDWeapon::createHUDChilds()
     {
-        if (weaponModes_ == NULL)
+        if (weapon_ == NULL)
         {
             return;
@@ -164,5 +161,5 @@
         int positionIndex = 0;
 
-        for (std::multimap<unsigned int, WeaponMode*>::iterator it = weaponModes_->begin(); it != weaponModes_->end(); ++it)
+        for (std::multimap<unsigned int, WeaponMode*>::const_iterator it = weapon_->getAllWeaponmodes().begin(); it != weapon_->getAllWeaponmodes().end(); ++it)
         {
             HUDWeaponMode* hudWeaponMode = new HUDWeaponMode(this->getContext());
@@ -208,7 +205,7 @@
     void HUDWeapon::updateSize()
     {
-        if (weaponModes_ != NULL)
-        {
-            this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weaponModes_->size()));
+        if (weapon_ != NULL)
+        {
+            this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weapon_->getAllWeaponmodes().size()));
             updatePosition();
         }        
@@ -217,5 +214,5 @@
     void HUDWeapon::updatePosition()
     {
-        if (weaponModes_ != NULL)
+        if (weapon_ != NULL)
         {
             this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,0.0f) + this->positionOffset_);
Index: code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeapon.h
===================================================================
--- code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeapon.h	(revision 11058)
+++ code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeapon.h	(revision 11059)
@@ -94,5 +94,4 @@
         WeakPtr<Weapon> weapon_;
 
-        std::multimap<unsigned int, WeaponMode*>* weaponModes_;
         std::vector<WeakPtr<HUDWeaponMode> > hudWeaponModes_;
 
Index: code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeaponSystem.cc
===================================================================
--- code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeaponSystem.cc	(revision 11058)
+++ code/branches/cpp11_v3/src/modules/overlays/hud/HUDWeaponSystem.cc	(revision 11059)
@@ -126,18 +126,21 @@
         destroyHUDChilds();
 
-        std::vector<WeaponPack*>* weaponPacks = owner_->getAllWeaponPacks();
+        if (owner_->getWeaponSystem())
+        {
+            const std::vector<WeaponPack*>& weaponPacks = owner_->getWeaponSystem()->getAllWeaponPacks();
 
-        for (std::vector<WeaponPack*>::const_iterator itPacks = weaponPacks->begin(); itPacks != weaponPacks->end(); ++itPacks)
-        {
-            std::vector<Weapon*>* weapons = (*itPacks)->getAllWeapons();
+            for (std::vector<WeaponPack*>::const_iterator itPacks = weaponPacks.begin(); itPacks != weaponPacks.end(); ++itPacks)
+            {
+                const std::vector<Weapon*>& weapons = (*itPacks)->getAllWeapons();
 
-            for (std::vector<Weapon*>::const_iterator itWeapons = weapons->begin(); itWeapons != weapons->end(); ++itWeapons)
-            {
-                this->weapons_.push_back(*itWeapons);
+                for (std::vector<Weapon*>::const_iterator itWeapons = weapons.begin(); itWeapons != weapons.end(); ++itWeapons)
+                {
+                    this->weapons_.push_back(*itWeapons);
+                }
             }
+
+            createHUDChilds();
+            positionHUDChilds();
         }
-
-        createHUDChilds();
-        positionHUDChilds();
     }
 
Index: code/branches/cpp11_v3/src/orxonox/weaponsystem/Weapon.h
===================================================================
--- code/branches/cpp11_v3/src/orxonox/weaponsystem/Weapon.h	(revision 11058)
+++ code/branches/cpp11_v3/src/orxonox/weaponsystem/Weapon.h	(revision 11059)
@@ -57,6 +57,6 @@
             void addWeaponmode(WeaponMode* weaponmode);
             WeaponMode* getWeaponmode(unsigned int index) const;
-            inline std::multimap<unsigned int, WeaponMode*>* getAllWeaponmodes()
-                { return &weaponmodes_; }
+            inline const std::multimap<unsigned int, WeaponMode*>& getAllWeaponmodes() const
+                { return weaponmodes_; }
             inline int getNumWeaponModes() const
                 { return weaponmodes_.size(); }
Index: code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponPack.cc	(revision 11058)
+++ code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponPack.cc	(revision 11059)
@@ -124,9 +124,4 @@
     }
 
-    std::vector<Weapon*>* WeaponPack::getAllWeapons()
-    {
-        return &weapons_;        
-    }    
-
     void WeaponPack::addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link)
     {
Index: code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponPack.h
===================================================================
--- code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponPack.h	(revision 11058)
+++ code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponPack.h	(revision 11059)
@@ -52,5 +52,6 @@
             void removeWeapon(Weapon * weapon);
             Weapon * getWeapon(unsigned int index) const;
-            std::vector<Weapon*>* getAllWeapons();
+            inline const std::vector<Weapon*>& getAllWeapons() const
+                { return weapons_; }
 
             inline size_t getNumWeapons() const
Index: code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponSystem.cc
===================================================================
--- code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 11058)
+++ code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 11059)
@@ -240,9 +240,4 @@
     }
 
-    std::vector<WeaponPack *> * WeaponSystem::getAllWeaponPacks()
-    {
-        return &weaponPacks_;
-    }    
-
     bool WeaponSystem::swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2)
     {
Index: code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponSystem.h
===================================================================
--- code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponSystem.h	(revision 11058)
+++ code/branches/cpp11_v3/src/orxonox/weaponsystem/WeaponSystem.h	(revision 11059)
@@ -67,5 +67,6 @@
             void removeWeaponPack(WeaponPack * wPack);
             WeaponPack * getWeaponPack(unsigned int index) const;
-            std::vector<WeaponPack *> * getAllWeaponPacks();
+            inline const std::vector<WeaponPack *>& getAllWeaponPacks() const
+                { return weaponPacks_; }
 
             // configure slots and firemodes
Index: code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.cc	(revision 11058)
+++ code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.cc	(revision 11059)
@@ -513,12 +513,4 @@
     }
 
-    std::vector<WeaponPack *> * Pawn::getAllWeaponPacks()
-    {
-        if (this->weaponSystem_)
-            return this->weaponSystem_->getAllWeaponPacks();
-        else
-            return 0;        
-    }
-
     void Pawn::addMunitionXML(Munition* munition)
     {
Index: code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.h	(revision 11058)
+++ code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.h	(revision 11059)
@@ -170,5 +170,4 @@
             void addWeaponPackXML(WeaponPack * wPack);
             WeaponPack * getWeaponPack(unsigned int index) const;
-            std::vector<WeaponPack *> * getAllWeaponPacks();
 
             void addMunitionXML(Munition* munition);
