Index: /code/trunk/src/orxonox/objects/WeaponSystem.cc
===================================================================
--- /code/trunk/src/orxonox/objects/WeaponSystem.cc	(revision 2097)
+++ /code/trunk/src/orxonox/objects/WeaponSystem.cc	(revision 2098)
@@ -48,4 +48,7 @@
     {
         RegisterObject(WeaponSystem);
+
+        this->activeWeaponSet_ = 0;
+        this->parentSpaceShip_ = 0;
     }
 
@@ -62,22 +65,30 @@
 
     //the first weaponSet is at n=0
-    void WeaponSystem::setActiveWeaponSet(int n)
+    void WeaponSystem::setActiveWeaponSet(unsigned int n)
     {
-        if ( (int) weaponSets_.size() <= n )
-            n=0;
-        this->activeWeaponSet_ = this->weaponSets_[n];
+        if (n < this->weaponSets_.size())
+            this->activeWeaponSet_ = this->weaponSets_[n];
     }
 
     //n is the n'th weaponSet, starting with zero
     //Spaceship.cc only needs to have the keybinding to a specific Set-number n
-    void WeaponSystem::fire(int n)
+    void WeaponSystem::fire(unsigned int n)
     {
-        if (n>=0)
+        if (n < this->weaponSets_.size())
             this->weaponSets_[n]->fire();
     }
 
-    WeaponSet * WeaponSystem::getWeaponSetPointer(int n)
+    void WeaponSystem::fire()
     {
-        return this->weaponSets_[n];
+        if (this->activeWeaponSet_)
+            this->activeWeaponSet_->fire();
+    }
+
+    WeaponSet * WeaponSystem::getWeaponSetPointer(unsigned int n)
+    {
+        if (n < this->weaponSets_.size())
+            return this->weaponSets_[n];
+        else
+            return 0;
     }
 
Index: /code/trunk/src/orxonox/objects/WeaponSystem.h
===================================================================
--- /code/trunk/src/orxonox/objects/WeaponSystem.h	(revision 2097)
+++ /code/trunk/src/orxonox/objects/WeaponSystem.h	(revision 2098)
@@ -48,7 +48,8 @@
 
             void attachWeaponSet(WeaponSet *wSet);
-            void fire(int n);
-            void setActiveWeaponSet(int n);
-            WeaponSet * getWeaponSetPointer(int n);
+            void fire();
+            void fire(unsigned int n);
+            void setActiveWeaponSet(unsigned int n);
+            WeaponSet * getWeaponSetPointer(unsigned int n);
 
             inline void WeaponSystem::setParentSpaceShip(SpaceShip *parentSpaceShip)
Index: /code/trunk/src/orxonox/objects/weaponSystem/Weapon.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2097)
+++ /code/trunk/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2098)
@@ -40,4 +40,8 @@
     {
         RegisterObject(Weapon);
+
+        this->loadingTime_ = 0;
+        this->munition_ = 0;
+
     }
 
Index: /code/trunk/src/orxonox/objects/weaponSystem/Weapon.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponSystem/Weapon.h	(revision 2097)
+++ /code/trunk/src/orxonox/objects/weaponSystem/Weapon.h	(revision 2098)
@@ -49,5 +49,5 @@
 
         private:
-            int loadingTime;
+            int loadingTime_;
             Munition *munition_;
 
Index: /code/trunk/src/orxonox/objects/weaponSystem/WeaponSet.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponSystem/WeaponSet.cc	(revision 2097)
+++ /code/trunk/src/orxonox/objects/weaponSystem/WeaponSet.cc	(revision 2098)
@@ -42,4 +42,6 @@
         RegisterObject(WeaponSet);
 
+        this->parentWeaponSystem_ = 0;
+
         for (int i=0;i<k;i++)
         {
@@ -68,7 +70,10 @@
     }
 
-    WeaponSlot * WeaponSet::getWeaponSlotPointer(int n)
+    WeaponSlot * WeaponSet::getWeaponSlotPointer(unsigned int n)
     {
-        return this->weaponSlots_[n];
+        if (n < this->weaponSlots_.size())
+            return this->weaponSlots_[n];
+        else
+            return 0;
     }
 
Index: /code/trunk/src/orxonox/objects/weaponSystem/WeaponSet.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponSystem/WeaponSet.h	(revision 2097)
+++ /code/trunk/src/orxonox/objects/weaponSystem/WeaponSet.h	(revision 2098)
@@ -50,5 +50,5 @@
             void WeaponSet::attachWeaponSlot(WeaponSlot *wSlot);
             void WeaponSet::fire();
-            WeaponSlot * getWeaponSlotPointer(int n);
+            WeaponSlot * getWeaponSlotPointer(unsigned int n);
 
             inline void WeaponSet::setParentWeaponSystem(WeaponSystem *parentWeaponSystem)
Index: /code/trunk/src/orxonox/objects/weaponSystem/WeaponSlot.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponSystem/WeaponSlot.cc	(revision 2097)
+++ /code/trunk/src/orxonox/objects/weaponSystem/WeaponSlot.cc	(revision 2098)
@@ -42,4 +42,9 @@
     {
         RegisterObject(WeaponSlot);
+
+        this->unlimitedAmmo_ = false;
+
+        this->attachedWeapon_ = 0;
+        this->parentWeaponSet_ = 0;
     }
 
Index: /code/trunk/src/orxonox/objects/weaponSystem/weapons/LaserGun.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponSystem/weapons/LaserGun.h	(revision 2097)
+++ /code/trunk/src/orxonox/objects/weaponSystem/weapons/LaserGun.h	(revision 2098)
@@ -35,5 +35,6 @@
 
 #include "LaserGunMunition.h"
-#include "../tools/BillboardSet.h"
+#include "tools/BillboardSet.h"
+#include "util/Math.h"
 
 namespace orxonox
Index: /code/trunk/src/orxonox/objects/weaponSystem/weapons/Missile.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponSystem/weapons/Missile.h	(revision 2097)
+++ /code/trunk/src/orxonox/objects/weaponSystem/weapons/Missile.h	(revision 2098)
@@ -32,10 +32,10 @@
 #include "OrxonoxPrereqs.h"
 
-#include "core/BaseObject.h"
+#include "objects/weaponSystem/Weapon.h"
 
 
 namespace orxonox
 {
-    class _OrxonoxExport Missile : public BaseObject : public Weapon
+    class _OrxonoxExport Missile : public Weapon
     {
         public:
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2097)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2098)
@@ -35,4 +35,5 @@
 #include "objects/infos/PlayerInfo.h"
 #include "objects/gametypes/Gametype.h"
+#include "objects/WeaponSystem.h"
 
 namespace orxonox
@@ -51,4 +52,13 @@
 
         this->lastHitOriginator_ = 0;
+        this->weaponSystem_ = 0;
+
+        /*
+        //WeaponSystem
+        weaponSystem_ = new WeaponSystem();
+        WeaponSet * weaponSet1 = new WeaponSet(1);
+        this->weaponSystem_->attachWeaponSet(weaponSet1);
+        this->weaponSystem_->getWeaponSetPointer(0)->getWeaponSlotPointer(0)->setAmmoType(true);
+        */
 
         this->registerVariables();
@@ -127,4 +137,10 @@
     }
 
+    void Pawn::fire()
+    {
+        if (this->weaponSystem_)
+            this->weaponSystem_->fire();
+    }
+
     void Pawn::postSpawn()
     {
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2097)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2098)
@@ -74,4 +74,6 @@
             virtual void kill();
 
+            virtual void fire();
+
             virtual void postSpawn();
 
@@ -87,4 +89,6 @@
 
             Pawn* lastHitOriginator_;
+
+            WeaponSystem* weaponSystem_;
     };
 }
