Index: /trunk/src/world_entities/playable.cc
===================================================================
--- /trunk/src/world_entities/playable.cc	(revision 7349)
+++ /trunk/src/world_entities/playable.cc	(revision 7350)
@@ -16,7 +16,6 @@
 
 #include "playable.h"
-
-#include "weapons/weapon_manager.h"
 #include "event_handler.h"
+
 #include "player.h"
 #include "state.h"
@@ -25,6 +24,4 @@
 #include "util/loading/load_param.h"
 
-#include "world_entities/projectiles/projectile.h"
-
 #include "power_ups/weapon_power_up.h"
 #include "power_ups/param_power_up.h"
@@ -38,4 +35,7 @@
 
 #include "effects/explosion.h"
+
+#include "shell_command.h"
+SHELL_COMMAND(orxoWeapon, Playable, addSomeWeapons_CHEAT);
 
 
@@ -122,9 +122,21 @@
  * @param slotID the slotID to add the Weapon to.
  */
-void Playable::addWeapon(Weapon* weapon, int configID, int slotID)
-{
-  this->weaponMan.addWeapon(weapon, configID, slotID);
-
-  this->weaponConfigChanged();
+bool Playable::addWeapon(Weapon* weapon, int configID, int slotID)
+{
+  if(this->weaponMan.addWeapon(weapon, configID, slotID))
+  {
+    this->weaponConfigChanged();
+    return true;
+  }
+  else
+  {
+    if (weapon != NULL)
+      PRINTF(2)("Unable to add Weapon (%s::%s) to %s::%s\n",
+             weapon->getClassName(), weapon->getName(), this->getClassName(), this->getName());
+    else
+      PRINTF(2)("No weapon defined\n");
+    return false;
+
+  }
 }
 
@@ -170,4 +182,17 @@
 }
 
+/**
+ * @brief a Cheat that gives us some Weapons
+ */
+void Playable::addSomeWeapons_CHEAT()
+{
+  PRINTF(2)("ADDING WEAPONS - you cheater\n");
+  this->addWeapon(Weapon::createWeapon(CL_HYPERBLASTER));
+  this->addWeapon(Weapon::createWeapon(CL_TURRET));
+  this->addWeapon(Weapon::createWeapon(CL_AIMING_TURRET));
+  this->addWeapon(Weapon::createWeapon(CL_CANNON));
+  this->addWeapon(Weapon::createWeapon(CL_TARGETING_TURRET));
+  PRINTF(2)("ADDING WEAPONS FINISHED\n");
+}
 
 /**
Index: /trunk/src/world_entities/playable.h
===================================================================
--- /trunk/src/world_entities/playable.h	(revision 7349)
+++ /trunk/src/world_entities/playable.h	(revision 7350)
@@ -43,5 +43,5 @@
   // Weapon and Pickups
   virtual bool pickup(PowerUp* powerUp);
-  void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1);
+  bool addWeapon(Weapon* weapon, int configID = -1, int slotID = -1);
   void removeWeapon(Weapon* weapon);
   void nextWeaponConfig();
@@ -49,4 +49,5 @@
   inline WeaponManager& getWeaponManager() { return this->weaponMan; };
   void weaponConfigChanged();
+  void addSomeWeapons_CHEAT();
 
 
Index: /trunk/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- /trunk/src/world_entities/weapons/aiming_turret.cc	(revision 7349)
+++ /trunk/src/world_entities/weapons/aiming_turret.cc	(revision 7350)
@@ -48,5 +48,6 @@
 {
   this->init();
-  this->loadParams(root);
+  if (root != NULL)
+    this->loadParams(root);
 }
 
Index: /trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- /trunk/src/world_entities/weapons/weapon.cc	(revision 7349)
+++ /trunk/src/world_entities/weapons/weapon.cc	(revision 7350)
@@ -26,4 +26,5 @@
 #include "util/loading/resource_manager.h"
 #include "class_list.h"
+#include "util/loading/factory.h"
 #include "util/loading/load_param.h"
 #include "state.h"
@@ -34,4 +35,6 @@
 
 #include "glgui_bar.h"
+
+using namespace std;
 
 ////////////////////
@@ -66,4 +69,24 @@
 
 /**
+ * @brief creates a new Weapon of type weaponID and returns it.
+ * @param weaponID the WeaponID type to create.
+ * @returns the newly created Weapon.
+ */
+Weapon* Weapon::createWeapon(ClassID weaponID)
+{
+  BaseObject* createdObject = Factory::fabricate(weaponID);
+  if (createdObject != NULL)
+  {
+    if (createdObject->isA(CL_WEAPON))
+      return dynamic_cast<Weapon*>(createdObject);
+    else
+    {
+      delete createdObject;
+      return NULL;
+    }
+  }
+}
+
+/**
  * initializes the Weapon with ALL default values
  *
@@ -72,4 +95,5 @@
 void Weapon::init()
 {
+  this->setClassID(CL_WEAPON, "Weapon");
   this->currentState     = WS_INACTIVE;            //< Normaly the Weapon is Inactive
   this->requestedAction  = WA_NONE;                //< No action is requested by default
@@ -382,19 +406,19 @@
   switch (action)
   {
-  case WA_SHOOT:
-    return this->fireW();
-    break;
-  case WA_CHARGE:
-    return this->chargeW();
-    break;
-  case WA_RELOAD:
-    return this->reloadW();
-    break;
-  case WA_DEACTIVATE:
-    return this->deactivateW();
-    break;
-  case WA_ACTIVATE:
-    return this->activateW();
-    break;
+    case WA_SHOOT:
+      return this->fireW();
+      break;
+    case WA_CHARGE:
+      return this->chargeW();
+      break;
+    case WA_RELOAD:
+      return this->reloadW();
+      break;
+    case WA_DEACTIVATE:
+      return this->deactivateW();
+      break;
+    case WA_ACTIVATE:
+      return this->activateW();
+      break;
   }
 }
@@ -495,5 +519,5 @@
   PRINTF(4)("Reloading Weapon %s\n", this->getName());
   if (this->ammoContainer.get() != NULL &&
-        unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge))
+      unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge))
   {
     this->requestAction(WA_DEACTIVATE);
@@ -643,25 +667,25 @@
   switch (action)
   {
-  case WA_SHOOT:
-    return "shoot";
-    break;
-  case WA_CHARGE:
-    return "charge";
-    break;
-  case WA_RELOAD:
-    return "reload";
-    break;
-  case WA_ACTIVATE:
-    return "activate";
-    break;
-  case WA_DEACTIVATE:
-    return "deactivate";
-    break;
-  case WA_SPECIAL1:
-    return "special1";
-    break;
-  default:
-    return "none";
-    break;
+    case WA_SHOOT:
+      return "shoot";
+      break;
+    case WA_CHARGE:
+      return "charge";
+      break;
+    case WA_RELOAD:
+      return "reload";
+      break;
+    case WA_ACTIVATE:
+      return "activate";
+      break;
+    case WA_DEACTIVATE:
+      return "deactivate";
+      break;
+    case WA_SPECIAL1:
+      return "special1";
+      break;
+    default:
+      return "none";
+      break;
   }
 }
@@ -706,28 +730,28 @@
   switch (state)
   {
-  case WS_SHOOTING:
-    return "shooting";
-    break;
-  case WS_CHARGING:
-    return "charging";
-    break;
-  case WS_RELOADING:
-    return "reloading";
-    break;
-  case WS_ACTIVATING:
-    return "activating";
-    break;
-  case WS_DEACTIVATING:
-    return "deactivating";
-    break;
-  case WS_IDLE:
-    return "idle";
-    break;
-  case WS_INACTIVE:
-    return "inactive";
-    break;
-  default:
-    return "none";
-    break;
-  }
-}
+    case WS_SHOOTING:
+      return "shooting";
+      break;
+    case WS_CHARGING:
+      return "charging";
+      break;
+    case WS_RELOADING:
+      return "reloading";
+      break;
+    case WS_ACTIVATING:
+      return "activating";
+      break;
+    case WS_DEACTIVATING:
+      return "deactivating";
+      break;
+    case WS_IDLE:
+      return "idle";
+      break;
+    case WS_INACTIVE:
+      return "inactive";
+      break;
+    default:
+      return "none";
+      break;
+  }
+}
Index: /trunk/src/world_entities/weapons/weapon.h
===================================================================
--- /trunk/src/world_entities/weapons/weapon.h	(revision 7349)
+++ /trunk/src/world_entities/weapons/weapon.h	(revision 7350)
@@ -88,4 +88,5 @@
     Weapon ();
     virtual ~Weapon ();
+    static Weapon* createWeapon(ClassID weaponID);
 
     void init();
Index: /trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- /trunk/src/world_entities/weapons/weapon_manager.cc	(revision 7349)
+++ /trunk/src/world_entities/weapons/weapon_manager.cc	(revision 7350)
@@ -17,5 +17,5 @@
 */
 
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+#define DEBUG_SPECIAL_MODULE 4 //DEBUG_MODULE_WEAPON
 
 #include "weapon_manager.h"
@@ -113,5 +113,5 @@
 
 /**
- * loads the settings of the WeaponManager
+ * @brief loads the settings of the WeaponManager
  * @param root the XML-element to load from
  */
@@ -133,5 +133,5 @@
 
 /**
- * loads a Weapon onto the WeaponManager
+ * @brief loads a Weapon onto the WeaponManager
  * @param root the XML-element to load the Weapons from
  */
@@ -148,5 +148,5 @@
 
 /**
- * sets the Parent of the WeaponManager.
+ * @brief sets the Parent of the WeaponManager.
  * @param parent the parent of the WeaponManager
  *
@@ -168,5 +168,5 @@
 
 /**
- * sets the number of Slots the WeaponManager has
+ * @brief sets the number of Slots the WeaponManager has
  * @param slotCount the number of slots
  */
@@ -181,5 +181,5 @@
 
 /**
- * sets the position of the Slot relative to the parent
+ * @brief sets the position of the Slot relative to the parent
  * @param slot the slot to set-up
  * @param position the position of the given slot
@@ -198,5 +198,5 @@
 
 /**
- * sets the relative rotation of the slot to its parent
+ * @brief sets the relative rotation of the slot to its parent
  * @param slot the slot to set-up
  * @param rotation the relative rotation of the given slot
@@ -210,5 +210,5 @@
 
 /**
- * adds a weapon to the selected weaponconfiguration into the selected slot
+ * @brief adds a weapon to the selected weaponconfiguration into the selected slot
  * @param weapon the weapon to add
  * @param configID an identifier for the slot: number between 0..7 if not specified: slotID=next free slot
