Index: /trunk/src/defs/debug.h
===================================================================
--- /trunk/src/defs/debug.h	(revision 5439)
+++ /trunk/src/defs/debug.h	(revision 5440)
@@ -43,51 +43,52 @@
 //definitions
 #ifndef MODULAR_DEBUG
-#define HARD_DEBUG_LEVEL DEBUG
-#define SOFT_DEBUG_LEVEL verbose
+ #define HARD_DEBUG_LEVEL DEBUG
+ #define SOFT_DEBUG_LEVEL verbose
 #else /* MODULAR_DEBUG */
-#ifndef DEBUG_MODULE_SOFT
-#define SOFT_DEBUG_LEVEL verbose
-#else /* DEBUG_MODULE_SOFT */
-#define SOFT_DEBUG_LEVEL DEBUG_MODULE_SOFT
-#endif /* DEBUG_MODULE_SOFT */
-
-#ifndef DEBUG_SPECIAL_MODULE
-#define HARD_DEBUG_LEVEL DEBUG
-#else /* DEBUG_SPECIAL_MODULE */
-////////////////////
-// DEFINE MODULES //
-////////////////////
-// FRAMEWORK
-#define DEBUG_MODULE_BASE                  2
-#define DEBUG_MODULE_ORXONOX               2
-#define DEBUG_MODULE_WORLD                 2
-#define DEBUG_MODULE_NETWORK               2
-
-// LOADING
-#define DEBUG_MODULE_LOAD                  2
-#define DEBUG_MODULE_IMPORTER              2
-
-// ENGINES
-#define DEBUG_MODULE_GRAPHICS              2
-#define DEBUG_MODULE_EVENT                 2
-#define DEBUG_MODULE_PHYSICS               2
-#define DEBUG_MODULE_GARBAGE_COLLECTOR     2
-#define DEBUG_MODULE_OBJECT_MANAGER        2
-#define DEBUG_MODULE_ANIM                  2
-#define DEBUG_MODULE_COLLISON_DETECTION    2
-#define DEBUG_MODULE_SPATIAL_SEPARATION    2
-#define DEBUG_MODULE_GUI                   2
-
-// MISC
-#define DEBUG_MODULE_TRACK_MANAGER         2
-#define DEBUG_MODULE_MATH                  2
-
-#define DEBUG_MODULE_PNODE                 2
-#define DEBUG_MODULE_WORLD_ENTITY          2
-
-#define DEBUG_MODULE_WEAPON                2
-
-#define HARD_DEBUG_LEVEL DEBUG_SPECIAL_MODULE
-#endif /* DEBUG_SPECIAL_MODULE */
+ #ifndef DEBUG_MODULE_SOFT
+  #define SOFT_DEBUG_LEVEL verbose
+ #else /* DEBUG_MODULE_SOFT */
+  #define SOFT_DEBUG_LEVEL DEBUG_MODULE_SOFT
+ #endif /* DEBUG_MODULE_SOFT */
+
+ #ifndef DEBUG_SPECIAL_MODULE
+  #define HARD_DEBUG_LEVEL DEBUG
+ #else /* DEBUG_SPECIAL_MODULE */
+  ////////////////////
+  // DEFINE MODULES //
+  ////////////////////
+  // FRAMEWORK
+  #define DEBUG_MODULE_BASE                  2
+  #define DEBUG_MODULE_ORXONOX               2
+  #define DEBUG_MODULE_WORLD                 2
+  #define DEBUG_MODULE_NETWORK               2
+
+  // LOADING
+  #define DEBUG_MODULE_LOAD                  2
+  #define DEBUG_MODULE_IMPORTER              2
+
+  // ENGINES
+  #define DEBUG_MODULE_GRAPHICS              2
+  #define DEBUG_MODULE_EVENT                 2
+  #define DEBUG_MODULE_PHYSICS               2
+  #define DEBUG_MODULE_GARBAGE_COLLECTOR     2
+  #define DEBUG_MODULE_OBJECT_MANAGER        2
+  #define DEBUG_MODULE_ANIM                  2
+  #define DEBUG_MODULE_COLLISON_DETECTION    2
+  #define DEBUG_MODULE_SPATIAL_SEPARATION    2
+  #define DEBUG_MODULE_GUI                   2
+
+  // MISC
+  #define DEBUG_MODULE_TRACK_MANAGER         2
+  #define DEBUG_MODULE_MATH                  2
+
+  #define DEBUG_MODULE_PNODE                 2
+  #define DEBUG_MODULE_WORLD_ENTITY          2
+
+  #define DEBUG_MODULE_WEAPON                2
+
+  #define HARD_DEBUG_LEVEL DEBUG_SPECIAL_MODULE
+
+ #endif /* DEBUG_SPECIAL_MODULE */
 #endif /* MODULAR_DEBUG */
 
Index: /trunk/src/world_entities/player.cc
===================================================================
--- /trunk/src/world_entities/player.cc	(revision 5439)
+++ /trunk/src/world_entities/player.cc	(revision 5440)
@@ -136,6 +136,8 @@
 
   this->weaponMan->setSlotPosition(0, Vector(-2.6, .1, -3.0));
+  this->weaponMan->setSlotCapability(0, WTYPE_ALLDIRS & WTYPE_DIRECTIONAL);
 
   this->weaponMan->setSlotPosition(1, Vector(-2.6, .1, 3.0));
+  this->weaponMan->setSlotCapability(1, WTYPE_ALLDIRS & WTYPE_DIRECTIONAL);
 
   this->weaponMan->setSlotPosition(2, Vector(-1.5, .5, -.5));
@@ -329,5 +331,4 @@
 
 // FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG
-int slot = 2;
 void Player::ADDWEAPON()
 {
@@ -336,5 +337,5 @@
   turret1->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1);
 
-  this->weaponMan->addWeapon(turret1, 2, slot++);
+  this->weaponMan->addWeapon(turret1, 2);
 
   this->weaponMan->changeWeaponConfig(2);
Index: /trunk/src/world_entities/weapons/turret.cc
===================================================================
--- /trunk/src/world_entities/weapons/turret.cc	(revision 5439)
+++ /trunk/src/world_entities/weapons/turret.cc	(revision 5440)
@@ -97,6 +97,4 @@
   this->setEmissionPoint(1.684, 0.472, 0);
   //this->getProjectileFactory()->prepare(100);
-
-
 }
 
@@ -140,5 +138,6 @@
   if (target != NULL)
   {
-    pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0   /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
+    pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(20)
+            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
   }
   else
@@ -148,7 +147,7 @@
   pj->setAbsCoor(this->getEmissionPoint());
   pj->setAbsDir(this->getAbsDir());
+
   State::getWorldEntityList()->add(pj);
 }
-
 
 void Turret::destroy ()
Index: /trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- /trunk/src/world_entities/weapons/weapon_manager.cc	(revision 5439)
+++ /trunk/src/world_entities/weapons/weapon_manager.cc	(revision 5440)
@@ -220,5 +220,5 @@
   if (unlikely(configID >= WM_MAX_CONFIGS || slotID >= (int)this->slotCount))
   {
-    PRINTF(2)("Slot %d of config %d is not availiabe\n", slotID, configID);
+    PRINTF(2)("Slot %d of config %d is not availiabe (max: %d)\n", slotID, configID, this->slotCount);
     return;
   }
@@ -238,5 +238,4 @@
 
   //! @todo check if the weapon is already assigned to another config in another slot
-
   this->configs[configID][slotID] = weapon;
   if (this->parent != NULL)
@@ -403,9 +402,10 @@
  * @param the selected weaponconfig
  */
-int WeaponManager::getNextFreeSlot(int configID)
+int WeaponManager::getNextFreeSlot(int configID, long capability)
 {
   for( int i = 0; i < this->slotCount; ++i)
   {
-    if( this->configs[configID][i] == NULL)
+    if( this->configs[configID][i] == NULL &&
+        (this->currentSlotConfig[i].capability & capability == this->currentSlotConfig[i].capability))
       return i;
   }
Index: /trunk/src/world_entities/weapons/weapon_manager.h
===================================================================
--- /trunk/src/world_entities/weapons/weapon_manager.h	(revision 5439)
+++ /trunk/src/world_entities/weapons/weapon_manager.h	(revision 5440)
@@ -87,5 +87,5 @@
 
   private:
-    int getNextFreeSlot(int configID);
+    int getNextFreeSlot(int configID, long capability = WTYPE_ALL);
 
   private:
