Index: /branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc	(revision 10660)
+++ /branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc	(revision 10661)
@@ -69,9 +69,4 @@
 
 #include "track/track.h"
-
-
-// #include "lib/gui/gl_gui/glgui_bar.h"
-// #include "lib/gui/gl_gui/glgui_pushbutton.h"
-
 
 
@@ -159,72 +154,51 @@
   //weapons:
 
-  Weapon* wpRight0 = new RFCannon ();
-  wpRight0->setName( "RFCannon");
-  Weapon* wpLeft0 = new RFCannon ();
-  wpLeft0->setName( "RFCannon");
-
-  Weapon* wpRight1 = new RFCannon ();
-  wpRight1->setName( "RFCannon");
-  Weapon* wpLeft1 = new RFCannon ();
-  wpLeft1->setName( "RFCannon");
-/*
-  Weapon* wpRight2 = new MediumBlaster ();
-  wpRight2->setName( "MediumBlaster");
-  Weapon* wpLeft2 = new MediumBlaster ();
-  wpLeft2->setName( "MediumBlaster");*/
-
-  Weapon* wpRight2 = new NadionLaser ();
-  wpRight2->setName( "NadionLaser");
-  Weapon* wpLeft2 = new NadionLaser ();
-  wpLeft2->setName( "NadionLaser");
-/*
-  Weapon* wpRight3 = new HeavyBlaster (1);
-  wpRight3->setName( "HeavyBlaster");
-  Weapon* wpLeft3 = new HeavyBlaster (0);
-  wpLeft3->setName( "HeavyBlaster");*/
-
-  Weapon* wpRight3 = new Disruptor ();
-  wpRight3->setName( "Disruptor");
-  Weapon* wpLeft3 = new Disruptor ();
-  wpLeft3->setName( "Disruptor");
-
-/*
-  Weapon* wpRight3 = Weapon::createWeapon( "Disruptor" );
-  wpRight3->setName( "Disruptor");
-  Weapon* wpLeft3 = Weapon::createWeapon( "Disruptor" );
-  wpLeft3->setName( "Disruptor");*/
-
-  Weapon* cannon = new SwarmLauncher();
-  cannon->setName( "SwarmLauncher");
-
-
-  this->weaponMan.addWeapon( wpLeft0, 0, 0);
-  this->weaponMan.addWeapon( wpRight0, 0, 1);
-
-  this->weaponMan.addWeapon( wpLeft1, 0, 2);
-  this->weaponMan.addWeapon( wpRight1, 0, 3);
-
-  this->weaponMan.addWeapon( wpLeft2, 1, 4);
-  this->weaponMan.addWeapon( wpRight2, 1, 5);
-
-  this->weaponMan.addWeapon( wpLeft3, 2, 6);
-  this->weaponMan.addWeapon( wpRight3, 2, 7);
-
-  this->weaponMan.addWeapon( wpLeft0, 3, 0);
-  this->weaponMan.addWeapon( wpRight0, 3, 1);
-
-  this->weaponMan.addWeapon( wpLeft1, 3, 2);
-  this->weaponMan.addWeapon( wpRight1, 3, 3);
-
-  this->weaponMan.addWeapon( wpLeft2, 3, 4);
-  this->weaponMan.addWeapon( wpRight2, 3, 5);
-
-  this->weaponMan.addWeapon( wpLeft3, 3, 6);
-  this->weaponMan.addWeapon( wpRight3, 3, 7);
-
-
-  this->secWeaponMan.addWeapon( cannon, 0, 2);
-
-  this->weaponMan.changeWeaponConfig(3);
+  this->weaponMan.setParentEntity( this);
+  this->secWeaponMan.setParentEntity( this);
+
+  this->setWMSlotCount(1,8);
+  this->setWMSlotCount(2,6);
+
+  this->createWeaponSlot(1, 0, Vector(3.006, 1.028, .155), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(1, 1, Vector(3.006, 1.028, -.155), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(1, 2, Vector(4.03, .063, .876), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(1, 3, Vector(4.03, -.063, -.876), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(1, 4, Vector(1.431, -.612, 2.691), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(1, 5, Vector(1.431, -.612, -2.691), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(1, 6, Vector(1.431, -.612, 3.254), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(1, 7, Vector(1.431, -.612, -3.254), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+
+  this->addWeaponToSlot(1, 0, 0, "RFCannon");
+  this->addWeaponToSlot(1, 0, 1, "RFCannon");
+  this->addWeaponToSlot(1, 0, 2, "RFCannon");
+  this->addWeaponToSlot(1, 0, 3, "RFCannon");
+  this->addWeaponToSlot(1, 1, 0, "RFCannon");
+  this->addWeaponToSlot(1, 1, 1, "RFCannon");
+  this->addWeaponToSlot(1, 1, 2, "RFCannon");
+  this->addWeaponToSlot(1, 1, 3, "RFCannon");
+
+  this->addWeaponToSlot(1, 0, 4, "NadionLaser");
+  this->addWeaponToSlot(1, 0, 5, "NadionLaser");
+  this->addWeaponToSlot(1, 2, 4, "NadionLaser");
+  this->addWeaponToSlot(1, 2, 5, "NadionLaser");
+
+  this->addWeaponToSlot(1, 0, 6, "Disruptor");
+  this->addWeaponToSlot(1, 0, 7, "Disruptor");
+  this->addWeaponToSlot(1, 3, 6, "Disruptor");
+  this->addWeaponToSlot(1, 3, 7, "Disruptor");
+
+
+  this->createWeaponSlot(2, 0, Vector(1.5, 3, 0), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(2, 1, Vector(2.6, 0, 3.0), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(2, 2, Vector(1.5, 0, -.5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(2, 3, Vector(1.5, 0, .5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(2, 4, Vector(1.5, 0, .5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->createWeaponSlot(2, 5, Vector(1.5, 0, -.5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->addWeaponToSlot(2, 0, 2, "SwarmLauncher");
+
+
+  this->weaponMan.changeWeaponConfig(0);
   this->secWeaponMan.changeWeaponConfig(0);
 
@@ -232,30 +206,12 @@
   Playable::weaponConfigChanged();
 
-//   reactorOutput     = 10;
   setReactor(10);
-//   weaponEnergyRegen = 10;       // 10 einheiten pro Sekunde
   setWeapon(10);
-//   engineSpeedBase   = 15;
   setEngine(15);
-//   shieldRegen       = 2;
-/*
-  shieldEnergyShare = 0.3;
-  weaponEnergyShare = 0.3;
-  engineEnergyShare = 0.4;*/
+
+
   setEnergyShare(.3,.3,.4);
-/*
-  shieldCur         = 100;
-  shieldMax         = 100;
-  shieldTH          = .2 * shieldMax;   // shield power must be 20% before shield kicks in again*/
   setShield(100, 100, .2, 2);
-/*
-  this->setHealth( 100);
-  this->setHealthMax( 100);*/
   setArmor(100, 100);
-/*
-  electronicCur = 50;
-  electronicMax = 50;
-  electronicRegen   = 3;
-  electronicTH      = .7 * electronicMax; // 30% of eDamage can be handled by the ship*/
   setElectronic(50, 50, .7, 3.0);
 
@@ -311,69 +267,4 @@
   //registerEvent(SDLK_PAGEDOWN);
   registerEvent(EV_MOUSE_MOTION);
-
-  this->weaponMan.setParentEntity( this);
-  this->secWeaponMan.setParentEntity( this);
-
-  this->weaponMan.setSlotCount(8);
-/*
-  this->weaponMan.setSlotPosition(0, Vector(3.006, 1.028, .155));
-  this->weaponMan.setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->weaponMan.setSlotPosition(1, Vector(3.006, 1.028, -.155));
-  this->weaponMan.setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->weaponMan.setSlotPosition(2, Vector(4.03, .063, .876));
-  this->weaponMan.setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(3, Vector(4.03, -.063, -.876));
-  this->weaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(4, Vector(1.431, -.612, 2.691));
-  this->weaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(5, Vector(1.431, -.612, -2.691));
-  this->weaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(6, Vector(1.431, -.612, 3.254));
-  this->weaponMan.setSlotDirection(6, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(7, Vector(1.431, -.612, -3.254));
-  this->weaponMan.setSlotDirection(7, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));*/
-
-  this->createPriWMSlot(0, Vector(3.006, 1.028, .155), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createPriWMSlot(1, Vector(3.006, 1.028, -.155), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createPriWMSlot(2, Vector(4.03, .063, .876), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createPriWMSlot(3, Vector(4.03, -.063, -.876), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createPriWMSlot(4, Vector(1.431, -.612, 2.691), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createPriWMSlot(5, Vector(1.431, -.612, -2.691), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createPriWMSlot(6, Vector(1.431, -.612, 3.254), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createPriWMSlot(7, Vector(1.431, -.612, -3.254), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->secWeaponMan.setSlotCount(6);
-/*
-  this->secWeaponMan.setSlotPosition(0, Vector(1.5, 3, 0));
-  this->secWeaponMan.setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->secWeaponMan.setSlotPosition(1, Vector(2.6, 0, 3.0));
-  this->secWeaponMan.setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->secWeaponMan.setSlotPosition(2, Vector(1.5, 0, -.5));
-  this->secWeaponMan.setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
-
-  this->secWeaponMan.setSlotPosition(3, Vector(1.5, 0, .5));
-  this->secWeaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
-
-  this->secWeaponMan.setSlotPosition(4, Vector(1.5, 0, .5));
-  this->secWeaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
-
-  this->secWeaponMan.setSlotPosition(5, Vector(1.5, 0, -.5));
-  this->secWeaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));*/
-
-  this->createSecWMSlot(0, Vector(1.5, 3, 0), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createSecWMSlot(1, Vector(2.6, 0, 3.0), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createSecWMSlot(2, Vector(1.5, 0, -.5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createSecWMSlot(3, Vector(1.5, 0, .5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createSecWMSlot(4, Vector(1.5, 0, .5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->createSecWMSlot(5, Vector(1.5, 0, -.5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
 
 
@@ -1230,2 +1121,9 @@
     this->isTravelDistanceInit = false;
 };
+
+void SpaceShip::addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName){
+  if (wm == 1) { this->weaponMan.addWeapon( Weapon::createWeapon( weaponName ), config, slot); }
+  if (wm == 1) { this->weaponMan.addWeapon( Weapon::createWeapon( weaponName ), config, slot); }
+  else return;
+}
+
Index: /branches/vs-enhencements/src/world_entities/space_ships/space_ship.h
===================================================================
--- /branches/vs-enhencements/src/world_entities/space_ships/space_ship.h	(revision 10660)
+++ /branches/vs-enhencements/src/world_entities/space_ships/space_ship.h	(revision 10661)
@@ -73,5 +73,5 @@
     inline void setEnergyShare(float shield, float weapon, float engine)
         { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; }
-          // dirty safty hack, prevents total share being bigger than 1!!
+          // dirty safety hack, prevents total share being bigger than 1!!
           this->shieldEnergyShare = shield * tmp;
           this->weaponEnergyShare = weapon * tmp;
@@ -82,12 +82,19 @@
     inline void updateHealth() { this->setHealth(this->armorCur); this->setHealthMax(this->armorMax); };
 
-    inline void setPriWM(int slot) { this->weaponMan.setSlotCount(slot); };
-    inline void setSecWM(int slot) { this->secWeaponMan.setSlotCount(slot); };
-    inline void createPriWMSlot( int slot, Vector location, long capability) {
-      this->weaponMan.setSlotPosition(slot, location);
-      this->weaponMan.setSlotCapability(slot, capability); };
-    inline void createSecWMSlot( int slot, Vector location, long capability) {
-      this->secWeaponMan.setSlotPosition(slot, location);
-      this->secWeaponMan.setSlotCapability(slot, capability); };
+    inline void setWMSlotCount(int wm, int slot) {
+      if (wm == 1) { this->weaponMan.setSlotCount(slot); }
+      if (wm == 2) { this->secWeaponMan.setSlotCount(slot); }
+      else return; };
+    inline void createWeaponSlot(int wm, int slot, Vector location, long capability) {
+      if (wm == 1) {
+        this->weaponMan.setSlotPosition(slot, location);
+        this->weaponMan.setSlotCapability(slot, capability); }
+      if (wm == 2) {
+        this->secWeaponMan.setSlotPosition(slot, location);
+        this->secWeaponMan.setSlotCapability(slot, capability); }
+      else return; };
+
+    void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName);
+
     //Functions for GUI
     inline float getShieldCur() { return this->shieldCur; };        //!< returns current shield value
Index: /branches/vs-enhencements/src/world_entities/weapons/disruptor.cc
===================================================================
--- /branches/vs-enhencements/src/world_entities/weapons/disruptor.cc	(revision 10660)
+++ /branches/vs-enhencements/src/world_entities/weapons/disruptor.cc	(revision 10661)
@@ -29,8 +29,6 @@
 #include "elements/glgui_energywidgetvertical.h"
 
+ObjectListDefinition(Disruptor);
 CREATE_FACTORY(Disruptor);
-// ObjectListDefinition(Disruptor);
-
-
 
 /**
Index: /branches/vs-enhencements/src/world_entities/weapons/disruptor.h
===================================================================
--- /branches/vs-enhencements/src/world_entities/weapons/disruptor.h	(revision 10660)
+++ /branches/vs-enhencements/src/world_entities/weapons/disruptor.h	(revision 10661)
@@ -15,5 +15,5 @@
 class Disruptor : public Weapon
 {
-//   ObjectListDeclaration(Disruptor);
+  ObjectListDeclaration(Disruptor);
   public:
     Disruptor();
Index: /branches/vs-enhencements/src/world_entities/weapons/nadion_laser.cc
===================================================================
--- /branches/vs-enhencements/src/world_entities/weapons/nadion_laser.cc	(revision 10660)
+++ /branches/vs-enhencements/src/world_entities/weapons/nadion_laser.cc	(revision 10661)
@@ -30,5 +30,5 @@
 
 //
-//ObjectListDefinition(NadionLaser);
+ObjectListDefinition(NadionLaser);
 CREATE_FACTORY(NadionLaser);
 /**
Index: /branches/vs-enhencements/src/world_entities/weapons/nadion_laser.h
===================================================================
--- /branches/vs-enhencements/src/world_entities/weapons/nadion_laser.h	(revision 10660)
+++ /branches/vs-enhencements/src/world_entities/weapons/nadion_laser.h	(revision 10661)
@@ -8,5 +8,5 @@
 class NadionLaser : public Weapon
 {
-  //ObjectListDeclaration(NadionLaser);
+  ObjectListDeclaration(NadionLaser);
   public:
     NadionLaser();
Index: /branches/vs-enhencements/src/world_entities/weapons/rf_cannon.cc
===================================================================
--- /branches/vs-enhencements/src/world_entities/weapons/rf_cannon.cc	(revision 10660)
+++ /branches/vs-enhencements/src/world_entities/weapons/rf_cannon.cc	(revision 10661)
@@ -29,5 +29,8 @@
 #include "elements/glgui_energywidgetvertical.h"
 
+
+ObjectListDefinition(RFCannon);
 CREATE_FACTORY(RFCannon);
+
 /**
  * Standard constructor
Index: /branches/vs-enhencements/src/world_entities/weapons/rf_cannon.h
===================================================================
--- /branches/vs-enhencements/src/world_entities/weapons/rf_cannon.h	(revision 10660)
+++ /branches/vs-enhencements/src/world_entities/weapons/rf_cannon.h	(revision 10661)
@@ -10,5 +10,5 @@
 class RFCannon : public Weapon
 {
-  //ObjectListDeclaration(RFCannon);
+  ObjectListDeclaration(RFCannon);
   public:
     RFCannon ();
