Index: code/branches/weapons/src/orxonox/objects/weaponSystem/Weapon.cc
===================================================================
--- code/branches/weapons/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2898)
+++ 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_;    }
 
