Index: code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.h	(revision 11071)
@@ -42,5 +42,5 @@
             virtual ~DefaultWeaponmodeLink();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
 
             inline void setFiremode(const unsigned int firemode)
Index: code/trunk/src/orxonox/weaponsystem/Munition.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Munition.cc	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/Munition.cc	(revision 11071)
@@ -52,11 +52,11 @@
         this->reloadTime_ = 0.5f;
 
-        this->lastFilledWeaponMode_ = NULL;
+        this->lastFilledWeaponMode_ = nullptr;
     }
 
     Munition::~Munition()
     {
-        for (std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
-            delete it->second;
+        for (const auto& mapEntry : this->assignedMagazines_)
+            delete mapEntry.second;
     }
 
@@ -76,5 +76,5 @@
             // For separated magazines we definitively need a given user
             if (!user)
-                return 0;
+                return nullptr;
 
             // Use the map to get the magazine assigned to the given user
@@ -90,5 +90,5 @@
         }
 
-        return 0;
+        return nullptr;
     }
 
@@ -200,5 +200,5 @@
                     magazine->munition_ = 0;
 
-                    if (this->reload(NULL))
+                    if (this->reload(nullptr))
                         // Successfully reloaded, continue recursively
                         return this->takeMunition(amount, 0);
@@ -262,5 +262,5 @@
         if (deployment_ != MunitionDeployment::Separate)
         {
-            user = NULL;
+            user = nullptr;
         }
 
@@ -271,5 +271,5 @@
             if (it->first == lastFilledWeaponMode_)
             {
-                lastFilledWeaponMode_ = NULL;
+                lastFilledWeaponMode_ = nullptr;
             }            
             delete it->second;
@@ -299,6 +299,6 @@
         {
             // Return true if any of the current magazines is not full (loading counts as full although it returns 0 munition)
-            for (std::map<WeaponMode*, Magazine*>::const_iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
-                if (it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)
+            for (const auto& mapEntry : this->assignedMagazines_)
+                if (mapEntry.second->munition_ < this->maxMunitionPerMagazine_ && mapEntry.second->bLoaded_)
                     return true;
         }
@@ -315,5 +315,5 @@
         {
             // Stacking munition means, if a magazine gets full, the munition adds to a new magazine
-            Magazine* magazine = this->getMagazine(NULL);
+            Magazine* magazine = this->getMagazine(nullptr);
             if (magazine)
             {
@@ -345,7 +345,7 @@
             std::map<WeaponMode*, Magazine*>::iterator it;
 
-            // If the pointer to the weapon mode whose magazine got munition added to is NULL, then set the iterator to the beginning of the map
+            // If the pointer to the weapon mode whose magazine got munition added to is nullptr, then set the iterator to the beginning of the map
             // Otherwise set it to the next weapon mode
-            if (lastFilledWeaponMode_ == NULL)
+            if (lastFilledWeaponMode_ == nullptr)
             {
                 it = this->assignedMagazines_.begin();
@@ -441,9 +441,9 @@
         for (unsigned int i = 0; i < addedMagazines; ++i)
         {
-            for (std::map<WeaponMode*, Magazine*>::iterator it = this->assignedMagazines_.begin(); it != this->assignedMagazines_.end(); ++it)
-            {
-                if (needReload(it->first))
-                {
-                    reload(it->first);
+            for (const auto& mapEntry : this->assignedMagazines_)
+            {
+                if (needReload(mapEntry.first))
+                {
+                    reload(mapEntry.first);
                     break;
                 }
@@ -515,5 +515,5 @@
         // If we don't use separate magazines, set user to 0
         if (deployment_ != MunitionDeployment::Separate)
-            user = NULL;
+            user = nullptr;
 
         // Remove the current magazine for the given user
@@ -523,5 +523,5 @@
             if (it->first == lastFilledWeaponMode_)
             {
-                lastFilledWeaponMode_ = NULL;
+                lastFilledWeaponMode_ = nullptr;
             }
             delete it->second;
Index: code/trunk/src/orxonox/weaponsystem/Munition.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Munition.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/Munition.h	(revision 11071)
@@ -39,13 +39,10 @@
 namespace orxonox
 {
-    namespace MunitionDeployment
+    enum class MunitionDeployment
     {
-        enum Value
-        {
-            Separate, // Every comsuming weapon mode has its own magazine. It is possible that one weapon mode is out of ammo while another still has some.
-            Share, // All comsuming weapon modes take their munition from the same magazine. If this magazine is empty a new one is loaded.
-            Stack // There is only one magazine where all the munition is stored. Use this deployment mode for heavy weapons loke rockets, bombs, ...
-        };
-    }
+        Separate, // Every comsuming weapon mode has its own magazine. It is possible that one weapon mode is out of ammo while another still has some.
+        Share, // All comsuming weapon modes take their munition from the same magazine. If this magazine is empty a new one is loaded.
+        Stack // There is only one magazine where all the munition is stored. Use this deployment mode for heavy weapons loke rockets, bombs, ...
+    };
 
     class _OrxonoxExport Munition : public BaseObject
@@ -69,5 +66,5 @@
             virtual ~Munition();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
 
             unsigned int getNumMunition(WeaponMode* user) const;
@@ -80,5 +77,5 @@
             inline unsigned int getMaxMunitionPerMagazine() const
                 { return this->maxMunitionPerMagazine_; }
-            inline MunitionDeployment::Value getMunitionDeployment() const
+            inline MunitionDeployment getMunitionDeployment() const
                 { return deployment_; }
 
@@ -115,5 +112,5 @@
             std::map<WeaponMode*, Magazine*> assignedMagazines_; // Maps weapon modes to magazines that are currently used.
 
-            MunitionDeployment::Value deployment_; // Defines the behaviour how munition and magazines are distributed to the consuming weapon modes.
+            MunitionDeployment deployment_; // Defines the behaviour how munition and magazines are distributed to the consuming weapon modes.
 
             bool bAllowMunitionRefilling_;
Index: code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/ReplenishingMunition.h	(revision 11071)
@@ -52,9 +52,9 @@
         public:
             ReplenishingMunition(Context* context);
-            virtual ~ReplenishingMunition() {}
+            virtual ~ReplenishingMunition() = default;
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
             
-            virtual float getProgress();
+            float getProgress();
             inline unsigned int getReplenishAmount() const
                 { return replenishAmount_; }
Index: code/trunk/src/orxonox/weaponsystem/Weapon.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Weapon.cc	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/Weapon.cc	(revision 11071)
@@ -45,6 +45,6 @@
         RegisterObject(Weapon);
 
-        this->weaponPack_ = 0;
-        this->weaponSlot_ = 0;
+        this->weaponPack_ = nullptr;
+        this->weaponSlot_ = nullptr;
         this->bReloading_ = false;
         this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
@@ -61,6 +61,6 @@
                 this->weaponPack_->removeWeapon(this);
 
-            for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
-                it->second->destroy();
+            for (const auto& mapEntry : this->weaponmodes_)
+                mapEntry.second->destroy();
         }
     }
@@ -85,12 +85,12 @@
     {
         unsigned int i = 0;
-        for (std::multimap<unsigned int, WeaponMode*>::const_iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+        for (const auto& mapEntry : this->weaponmodes_)
         {
             if (i == index)
-                return it->second;
+                return mapEntry.second;
 
             ++i;
         }
-        return 0;
+        return nullptr;
     }
 
@@ -140,6 +140,6 @@
     void Weapon::reload()
     {
-        for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
-            it->second->reload();
+        for (const auto& mapEntry : this->weaponmodes_)
+            mapEntry.second->reload();
     }
 
@@ -152,12 +152,12 @@
     void Weapon::notifyWeaponModes()
     {
-        for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
-            it->second->setWeapon(this);
+        for (const auto& mapEntry : this->weaponmodes_)
+            mapEntry.second->setWeapon(this);
     }
 
     void Weapon::updateMunition()
     {
-        for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
-            it->second->updateMunition();
+        for (const auto& mapEnty : this->weaponmodes_)
+            mapEnty.second->updateMunition();
     }
 }
Index: code/trunk/src/orxonox/weaponsystem/Weapon.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Weapon.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/Weapon.h	(revision 11071)
@@ -50,5 +50,5 @@
             virtual ~Weapon();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
 
             void fire(unsigned int mode);
@@ -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/trunk/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponMode.cc	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponMode.cc	(revision 11071)
@@ -51,8 +51,8 @@
         RegisterObject(WeaponMode);
 
-        this->weapon_ = 0;
+        this->weapon_ = nullptr;
         this->mode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
 
-        this->munition_ = 0;
+        this->munition_ = nullptr;
         this->initialMunition_ = 0;
         this->initialMagazines_ = 0;
@@ -244,5 +244,5 @@
         else
         {
-            this->munition_ = NULL;
+            this->munition_ = nullptr;
         }
     }
Index: code/trunk/src/orxonox/weaponsystem/WeaponMode.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponMode.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponMode.h	(revision 11071)
@@ -52,5 +52,5 @@
             virtual ~WeaponMode();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
 
             bool fire(float* reloadTime);
Index: code/trunk/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponPack.cc	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponPack.cc	(revision 11071)
@@ -44,5 +44,5 @@
         RegisterObject(WeaponPack);
 
-        this->weaponSystem_ = 0;
+        this->weaponSystem_ = nullptr;
     }
 
@@ -76,6 +76,6 @@
     void WeaponPack::fire(unsigned int weaponmode)
     {
-        for (std::vector<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
-            (*it)->fire(weaponmode);
+        for (Weapon* weapon : this->weapons_)
+            weapon->fire(weaponmode);
     }
 
@@ -86,6 +86,6 @@
     void WeaponPack::reload()
     {
-        for (std::vector<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
-            (*it)->reload();
+        for (Weapon* weapon : this->weapons_)
+            weapon->reload();
     }
 
@@ -107,5 +107,5 @@
         assert(it != this->weapons_.end());
         this->weapons_.erase(it);
-        weapon->setWeaponPack(0);
+        weapon->setWeaponPack(nullptr);
     }
 
@@ -114,18 +114,13 @@
         unsigned int i = 0;
 
-        for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+        for (Weapon* weapon : this->weapons_)
         {
             if (i == index)
-                return (*it);
+                return weapon;
             ++i;
         }
 
-        return 0;
+        return nullptr;
     }
-
-    std::vector<Weapon*>* WeaponPack::getAllWeapons()
-    {
-        return &weapons_;        
-    }    
 
     void WeaponPack::addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link)
@@ -137,19 +132,19 @@
     {
         unsigned int i = 0;
-        for (std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)
+        for (DefaultWeaponmodeLink* link : this->links_)
         {
             if (i == index)
-                return (*it);
+                return link;
 
             ++i;
         }
-        return 0;
+        return nullptr;
     }
 
     unsigned int WeaponPack::getDesiredWeaponmode(unsigned int firemode) const
     {
-        for (std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)
-            if ((*it)->getFiremode() == firemode)
-                return (*it)->getWeaponmode();
+        for (DefaultWeaponmodeLink* link : this->links_)
+            if (link->getFiremode() == firemode)
+                return link->getWeaponmode();
 
         return WeaponSystem::WEAPON_MODE_UNASSIGNED;
@@ -158,12 +153,12 @@
     void WeaponPack::notifyWeapons()
     {
-        for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
-            (*it)->setWeaponPack(this);
+        for (Weapon* weapon : this->weapons_)
+            weapon->setWeaponPack(this);
     }
 
     void WeaponPack::updateMunition()
     {
-        for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
-            (*it)->updateMunition();
+        for (Weapon* weapon : this->weapons_)
+            weapon->updateMunition();
     }
 }
Index: code/trunk/src/orxonox/weaponsystem/WeaponPack.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponPack.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponPack.h	(revision 11071)
@@ -44,5 +44,5 @@
             virtual ~WeaponPack();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
 
             void fire(unsigned int weaponmode);
@@ -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/trunk/src/orxonox/weaponsystem/WeaponSet.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSet.cc	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSet.cc	(revision 11071)
@@ -43,5 +43,5 @@
         RegisterObject(WeaponSet);
 
-        this->weaponSystem_ = 0;
+        this->weaponSystem_ = nullptr;
         this->desiredFiremode_ = WeaponSystem::FIRE_MODE_UNASSIGNED;
     }
@@ -63,7 +63,7 @@
     {
         // Fire all WeaponPacks with their defined weaponmode
-        for (std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.begin(); it != this->weaponpacks_.end(); ++it)
-            if (it->second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
-                it->first->fire(it->second);
+        for (const auto& mapEntry : this->weaponpacks_)
+            if (mapEntry.second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
+                mapEntry.first->fire(mapEntry.second);
     }
 
@@ -71,6 +71,6 @@
     {
         // Reload all WeaponPacks with their defined weaponmode
-        for (std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.begin(); it != this->weaponpacks_.end(); ++it)
-            it->first->reload();
+        for (const auto& mapEntry : this->weaponpacks_)
+            mapEntry.first->reload();
     }
 
Index: code/trunk/src/orxonox/weaponsystem/WeaponSet.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSet.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSet.h	(revision 11071)
@@ -44,5 +44,5 @@
             virtual ~WeaponSet();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
 
             void fire();
Index: code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc	(revision 11071)
@@ -43,6 +43,6 @@
         RegisterObject(WeaponSlot);
 
-        this->weaponSystem_ = 0;
-        this->weapon_ = 0;
+        this->weaponSystem_ = nullptr;
+        this->weapon_ = nullptr;
 
         this->setSyncMode(ObjectDirection::None);
@@ -88,6 +88,6 @@
         if (this->weapon_)
         {
-            this->weapon_->setWeaponSlot(0);
-            this->weapon_ = 0;
+            this->weapon_->setWeaponSlot(nullptr);
+            this->weapon_ = nullptr;
         }
     }
Index: code/trunk/src/orxonox/weaponsystem/WeaponSlot.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSlot.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSlot.h	(revision 11071)
@@ -62,5 +62,5 @@
             virtual ~WeaponSlot();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
 
             void attachWeapon(Weapon * weapon);
@@ -74,5 +74,5 @@
             */
             inline bool isOccupied() const
-                { return (this->weapon_ != 0); }
+                { return (this->weapon_ != nullptr); }
 
             inline void setWeaponSystem(WeaponSystem * weaponSystem)
Index: code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 11071)
@@ -52,5 +52,5 @@
         RegisterObject(WeaponSystem);
 
-        this->pawn_ = 0;
+        this->pawn_ = nullptr;
     }
 
@@ -60,5 +60,5 @@
         {
             if (this->pawn_)
-                this->pawn_->setWeaponSystem(0);
+                this->pawn_->setWeaponSystem(nullptr);
 
             while (!this->weaponSets_.empty())
@@ -106,11 +106,11 @@
     {
         unsigned int i = 0;
-        for (std::vector<WeaponSlot*>::const_iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        for (WeaponSlot* weaponSlot : this->weaponSlots_)
         {
             ++i;
             if (i > index)
-                return (*it);
-        }
-        return 0;
+                return weaponSlot;
+        }
+        return nullptr;
     }
 
@@ -153,11 +153,11 @@
     {
         unsigned int i = 0;
-        for (std::map<unsigned int, WeaponSet*>::const_iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+        for (const auto& mapEntry : this->weaponSets_)
         {
             ++i;
             if (i > index)
-                return it->second;
-        }
-        return 0;
+                return mapEntry.second;
+        }
+        return nullptr;
     }
 
@@ -168,7 +168,7 @@
 
         unsigned int freeSlots = 0;
-        for (std::vector<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
-        {
-            if (!(*it)->isOccupied())
+        for (WeaponSlot* weaponSlot : this->weaponSlots_)
+        {
+            if (!weaponSlot->isOccupied())
                 ++freeSlots;
         }
@@ -184,10 +184,10 @@
         // Attach all weapons to the first free slots (and to the Pawn)
         unsigned int i = 0;
-        for (std::vector<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
-        {
-            if (!(*it)->isOccupied() && i < wPack->getNumWeapons())
+        for (WeaponSlot* weaponSlot : this->weaponSlots_)
+        {
+            if (!weaponSlot->isOccupied() && i < wPack->getNumWeapons())
             {
                 Weapon* weapon = wPack->getWeapon(i);
-                (*it)->attachWeapon(weapon);
+                weaponSlot->attachWeapon(weapon);
                 this->getPawn()->attach(weapon);
                 ++i;
@@ -196,9 +196,9 @@
 
         // Assign the desired weaponmode to the firemodes
-        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
-        {
-            unsigned int weaponmode = wPack->getDesiredWeaponmode(it->first);
+        for (const auto& mapEntry : this->weaponSets_)
+        {
+            unsigned int weaponmode = wPack->getDesiredWeaponmode(mapEntry.first);
             if (weaponmode != WeaponSystem::WEAPON_MODE_UNASSIGNED)
-                it->second->setWeaponmodeLink(wPack, weaponmode);
+                mapEntry.second->setWeaponmodeLink(wPack, weaponmode);
         }
 
@@ -213,5 +213,5 @@
         // Remove all weapons from their WeaponSlot
         unsigned int i = 0;
-        Weapon* weapon = 0;
+        Weapon* weapon = nullptr;
         while ((weapon = wPack->getWeapon(i++)))
             if (weapon->getWeaponSlot())
@@ -219,6 +219,6 @@
 
         // Remove all added links from the WeaponSets
-        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
-            it->second->removeWeaponmodeLink(wPack);
+        for (const auto& mapEntry : this->weaponSets_)
+            mapEntry.second->removeWeaponmodeLink(wPack);
 
         // Remove the WeaponPack from the WeaponSystem
@@ -231,17 +231,12 @@
     {
         unsigned int i = 0;
-        for (std::vector<WeaponPack*>::const_iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)
+        for (WeaponPack* weaponPack : this->weaponPacks_)
         {
             ++i;
             if (i > index)
-                return (*it);
-        }
-        return 0;
-    }
-
-    std::vector<WeaponPack *> * WeaponSystem::getAllWeaponPacks()
-    {
-        return &weaponPacks_;
-    }    
+                return weaponPack;
+        }
+        return nullptr;
+    }
 
     bool WeaponSystem::swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2)
@@ -273,7 +268,7 @@
         // Check if the WeaponSet belongs to this WeaponSystem
         bool foundWeaponSet = false;
-        for (std::map<unsigned int, WeaponSet *>::iterator it2 = this->weaponSets_.begin(); it2 != this->weaponSets_.end(); ++it2)
-        {
-            if (it2->second == wSet)
+        for (const auto& mapEntry : this->weaponSets_)
+        {
+            if (mapEntry.second == wSet)
             {
                 foundWeaponSet = true;
@@ -301,6 +296,6 @@
     void WeaponSystem::reload()
     {
-        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
-            it->second->reload();
+        for (const auto& mapEntry : this->weaponSets_)
+            mapEntry.second->reload();
     }
 
@@ -308,5 +303,5 @@
     {
         if (!identifier || !identifier->getIdentifier())
-            return 0;
+            return nullptr;
 
         std::map<Identifier *, Munition *>::iterator it = this->munitions_.find(identifier->getIdentifier());
@@ -317,5 +312,5 @@
         else
         {
-            return NULL;
+            return nullptr;
         }
     }
@@ -323,5 +318,5 @@
     void WeaponSystem::addMunition(Munition* munition)
     {
-        if (munition == NULL)
+        if (munition == nullptr)
         {
             return;
@@ -337,5 +332,5 @@
         else
         {
-            orxout(internal_warning) << "Adding munition failed. identifier == NULL " << endl;
+            orxout(internal_warning) << "Adding munition failed. identifier == nullptr " << endl;
         }
     }
@@ -343,7 +338,7 @@
     void WeaponSystem::updateMunition()
     {
-        for (std::vector<WeaponPack*>::iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)
-        {
-            (*it)->updateMunition();
+        for (WeaponPack* weaponPack : this->weaponPacks_)
+        {
+            weaponPack->updateMunition();
         }
     }
Index: code/trunk/src/orxonox/weaponsystem/WeaponSystem.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSystem.h	(revision 11052)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSystem.h	(revision 11071)
@@ -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
