Index: branches/adm/src/world_entities/effects/explosion.h
===================================================================
--- branches/adm/src/world_entities/effects/explosion.h	(revision 10690)
+++ branches/adm/src/world_entities/effects/explosion.h	(revision 10694)
@@ -27,5 +27,7 @@
     virtual void tick (float time);
 
-  private:
+    void setLifeTime( float lifeTime ){ this->lifeTime = lifeTime; }
+
+  protected:
     static FastFactory*        fastFactory;
 
Index: branches/adm/src/world_entities/npcs/adm_turret.cc
===================================================================
--- branches/adm/src/world_entities/npcs/adm_turret.cc	(revision 10690)
+++ branches/adm/src/world_entities/npcs/adm_turret.cc	(revision 10694)
@@ -76,4 +76,6 @@
 		LoadParamXML(root, "Sensor", this, AdmTurret, addSensor)
   			.describe("add sensor to ADM");
+		LoadParamXML(root, "Weapon", this, AdmTurret, addWeapon)
+  			.describe("add weapon to ADM");
 
 	}
@@ -137,5 +139,4 @@
         this->range = 400;
         this->isCeil = false;
-        this->bFire = false;
         this->playerVisible = false;
 
@@ -146,5 +147,5 @@
 {
   WorldEntity::tick(dt);
-  
+  this->weapon->fire(false);
   this->updatePlayerVisible();
 
@@ -158,15 +159,15 @@
   {
     this->moveTowards( ds,  dt);
-
-  //if target within +/- 2.5 degrees of aim -> fire
-  Vector dv1 = ds;
-  dv1.normalize();
-  Vector dv2 = this->cannons->getAbsDir().apply( Vector(-1, 0, 0));
-  dv2.normalize();
-  float angle = dv1.dot(dv2);
-  if (angle > 0.999)
-	{
-	this->fire();
-	}
+    
+    //if target within +/- 2.5 degrees of aim -> fire
+    Vector dv1 = ds;
+    dv1.normalize();
+    Vector dv2 = this->cannons->getAbsDir().apply( Vector(-1, 0, 0));
+    dv2.normalize();
+    float angle = dv1.dot(dv2);
+    if (angle > 0.999)
+	  {
+     this->weapon->fire(true);
+	  }
   }
   else
@@ -178,5 +179,5 @@
   WorldEntity::draw();
 
-
+#if 0
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
@@ -212,5 +213,5 @@
   glPopAttrib();
   glPopMatrix();
-  
+#endif
 }
 
@@ -227,11 +228,7 @@
 }
 
-void AdmTurret::fire()
-{
-}
-
 void AdmTurret::addCannons( const TiXmlElement * root )
 {
-	this->cannons = new WorldEntity();
+  this->cannons = new WorldEntity();
 	this->cannons->setParent(this);
 	this->cannons->loadParams( root );
@@ -242,9 +239,14 @@
 	this->cannons->toList( getOMListNumber() );
 
+
+}
+
+void AdmTurret::addWeapon( const TiXmlElement * root )
+{
 	this->weapon = new BspWeapon();
+	this->weapon->setParent( this->cannons );
 	this->weapon->loadParams(root);
-	this->weapon->setParent( this->cannons );
 	this->weapon->toList( getOMListNumber() );
-	this->weapon->setAbsCoor( this->cannons->getAbsCoor() );
+	//this->weapon->setAbsCoor( this->cannons->getAbsCoor() );
 	this->weapon->setAbsDir( this->weapon->getAbsDir() * Quaternion( PI, Vector(0, 1, 0) ) );
 }
@@ -252,5 +254,5 @@
 void AdmTurret::addSensor( const TiXmlElement * root )
 {
-	this->sensor = new WorldEntity();
+  this->sensor = new WorldEntity();
 	this->sensor->setParent(this);
 	this->sensor->loadParams( root );
@@ -285,5 +287,4 @@
    if ( isCeil )
    {
-     printf( "ceil\n" );
      baseRot = Quaternion( PI, Vector( 1, 0, 0 ) );
    }
Index: branches/adm/src/world_entities/npcs/adm_turret.h
===================================================================
--- branches/adm/src/world_entities/npcs/adm_turret.h	(revision 10690)
+++ branches/adm/src/world_entities/npcs/adm_turret.h	(revision 10694)
@@ -37,8 +37,8 @@
                    WorldEntity* sensor;
                    WorldEntity* myTarget;
-                   void fire();
 
 		   void addCannons(const TiXmlElement* root);
 		   void addSensor(const TiXmlElement* root);
+		   void addWeapon(const TiXmlElement* root);
 
 		   void moveTowards( Vector targetDir, float dt );
@@ -53,5 +53,4 @@
                    void setType( const std::string& type );
                    
-                   bool bFire;
                    bool playerVisible;
                    void updatePlayerVisible();
@@ -61,2 +60,3 @@
 
 #endif
+
Index: branches/adm/src/world_entities/weapons/bsp_weapon.cc
===================================================================
--- branches/adm/src/world_entities/weapons/bsp_weapon.cc	(revision 10690)
+++ branches/adm/src/world_entities/weapons/bsp_weapon.cc	(revision 10694)
@@ -21,7 +21,10 @@
 
 #include "environments/bsp_entity.h"
+#include "loading/fast_factory.h"
 
 ObjectListDefinition(BspWeapon);
 CREATE_FACTORY(BspWeapon);
+
+ObjectListDefinition(MuzzleFlash);
 
 /**
@@ -73,6 +76,8 @@
 		LOAD_PARAM_START_CYCLE(root, element);
 		{
-			LoadParam_CYCLE(element, "addPoint", this, BspWeapon, addPoint)
-			.describe("Adds a new Point for Gunfire");
+			if (root != 0){
+				LoadParam_CYCLE(element, "addPoint", this, BspWeapon, addPoint)
+				.describe("Adds a new Point for Gunfire");
+			}
 		}
 		LOAD_PARAM_END_CYCLE(element);
@@ -82,11 +87,7 @@
 void BspWeapon::addPoint(float x, float y, float z)
 {
-	if (element == 1 ){
-		gunFire1->setRelCoor(Vector(x,y,z));
-		element++;
-	}
-	if (element == 2 ){
-		gunFire2->setRelCoor(Vector(x,y,z));
-	}
+  gunFire.push_back( new MuzzleFlash() );
+	gunFire.back()->setParent( this->getParent() );
+	gunFire.back()->setRelCoor(x, y, z);
 }
 
@@ -107,4 +108,5 @@
 			bRate = 0;
 	}
+
 }
 
@@ -112,10 +114,9 @@
 {
 	bRate = 0;
-	bFire = true;
+	bFire = false;
 	range = 1000;
 	damage = 10;
 	fireRate = 0.5;
 	alwaysHits = true;
-	element=1;
 
 	this->registerObject(this, BspWeapon::_objectList);
@@ -123,10 +124,17 @@
 	this->aimingSystem->setParent( this );
 	this->aimingSystem->toList(OM_GROUP_00);
+	
 }
 
 void BspWeapon::shoot()
 {
-	gunFire.explode(gunFire1,Vector(2,2,2));
-	gunFire.explode(gunFire2,Vector(2,2,2));
+	//gunFirExpl.explode(gunFire1,Vector(2,2,2));
+	//gunFirExpl.explode(gunFire2,Vector(2,2,2));
+
+  for ( std::list<MuzzleFlash*>::iterator it = gunFire.begin(); it!=gunFire.end(); it++)
+	{
+    (*it)->explode( 0.2 );
+	}
+
 	std::list<WorldEntity*>::iterator entityIterator;
 	// for all bsp managers check all entities
@@ -151,9 +159,7 @@
 
 	if ( target == NULL )
-		printf("NOTING HIT\n");
+		printf("NO TARGET\n");
 	else
 	{
-		printf( "HIT %s\n", target->getClassName().c_str() );
-
 		if (!alwaysHits){
 			float r = rand();
@@ -161,6 +167,11 @@
 			float res = (target->getAbsCoor() - this->getAbsCoor()).len();
 			float p = 1 - res*res/range/range;
-			if (r < p )
+			if (r < p ){
 				hit = true;
+				printf( "HIT %s\n", target->getClassName().c_str() );
+			}
+			else
+				printf( "MISHIT %s\n", target->getClassName().c_str() );
+			
 		}
 		else hit = true;
@@ -169,9 +180,9 @@
 	if ( !hit )
 	{
-		Vector explosionPos = this->getAbsCoor() + this->getAbsDir().apply( Vector( 1, 0, 0 ) )*shortestDist;
+		//Vector explosionPos = this->getAbsCoor() + this->getAbsDir().apply( Vector( 1, 0, 0 ) )*shortestDist;
 
 		//TODO create explosion at explosionPos
 	}
-
+	
 	
 }
@@ -181,5 +192,9 @@
   WorldEntity::draw();
 
-
+  for ( std::list<MuzzleFlash*>::const_iterator it = gunFire.begin(); it!=gunFire.end(); it++)
+  {
+    (*it)->draw();
+  }
+#if 0
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
@@ -207,4 +222,96 @@
   glPopAttrib();
   glPopMatrix();
-  
-}
+#endif
+}
+
+void MuzzleFlash::draw( ) const
+{
+  if (explosionParticles) explosionParticles->draw();
+}
+
+void MuzzleFlash::activate()
+{
+	if (unlikely(explosionParticles == NULL))
+	{
+		explosionParticles = new SpriteParticles(5000);
+		explosionParticles->setName("MuzzleFlashExplosionParticles");
+		explosionParticles->setMaterialTexture("textures/radial-trans-noise.png");
+		explosionParticles->setLifeSpan(0.1, 0);
+		explosionParticles->setRadius(0.0, 8);
+		explosionParticles->setRadius(.5, 6.0);
+		explosionParticles->setRadius(1.0, 2.0);
+		explosionParticles->setColor(0.0, 1,0.7,0,1);
+		explosionParticles->setColor(0.4, 0.8,.5,0,1);
+		explosionParticles->setColor(0.8, 0.5,0,0,.8);
+		explosionParticles->setColor(1.0, 0,0,0,.6);
+    explosionParticles->toList(OM_DEAD_TICK);
+  }
+			
+	this->emitter->setSystem(explosionParticles);
+	this->emitter->updateNode(.01);
+	this->emitter->updateNode(.01);
+	this->toList(OM_DEAD_TICK);
+	this->lifeCycle = 0.0;
+}
+
+void MuzzleFlash::explode(float lifetime)
+{
+	MuzzleFlash* explosion = this;
+	//explosion->setAbsCoor(this->getAbsCoor());
+	explosion->emitter->setSize(1, 1, 1);
+	explosion->activate();
+	explosion->lifeTime = lifetime;
+}
+
+MuzzleFlash::MuzzleFlash ()
+{
+  this->explosionParticles = NULL;
+  this->registerObject(this, MuzzleFlash::_objectList);
+  this->toList(OM_DEAD_TICK);
+
+  this->emitter = new BoxEmitter(Vector(10,10,10), 200, 45, M_2_PI);
+  this->emitter->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+
+  this->lifeCycle = 0.0f;
+  this->lifeTime = .5f;
+
+}
+
+
+/**
+ *  standard deconstructor
+*/
+MuzzleFlash::~MuzzleFlash ()
+{
+  delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (explosionParticles != NULL)
+  {
+    delete explosionParticles;
+    MuzzleFlash::explosionParticles = NULL;
+  }
+}
+
+void MuzzleFlash::deactivate()
+{
+  this->emitter->setSystem(NULL);
+  this->toList(OM_DEAD);
+}
+
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param time since last tick
+*/
+void MuzzleFlash::tick (float dt)
+{
+  this->lifeCycle += dt;
+  if(this->lifeTime < this->lifeCycle)
+    this->deactivate();
+}
+
+
+
Index: branches/adm/src/world_entities/weapons/bsp_weapon.h
===================================================================
--- branches/adm/src/world_entities/weapons/bsp_weapon.h	(revision 10690)
+++ branches/adm/src/world_entities/weapons/bsp_weapon.h	(revision 10694)
@@ -10,4 +10,40 @@
 #include "aiming_system.h"
 #include "effects/explosion.h"
+
+#include <list>
+
+#include "particles/box_emitter.h"
+#include "particles/sprite_particles.h"
+
+class MuzzleFlash : public WorldEntity
+{
+  ObjectListDeclaration(MuzzleFlash);
+  public:
+    void explode (float lifetime);
+
+    MuzzleFlash ();
+    virtual ~MuzzleFlash ();
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick (float time);
+    virtual void draw() const;
+
+    void setLifeTime( float lifeTime ){ this->lifeTime = lifeTime; }
+    
+    void drawParticles(){ if (explosionParticles) explosionParticles->draw(); }
+
+  protected:
+    //static FastFactory*        fastFactory;
+
+    float                      lifeTime;
+    float                      lifeCycle;
+
+    SpriteParticles*    explosionParticles;
+    BoxEmitter*                emitter;
+
+};
+
 
 class BspWeapon : public WorldEntity
@@ -38,12 +74,9 @@
 		void setAlwaysHits( bool r ){ this->alwaysHits = r; }
 		void addPoint(float x, float y, float z);
-		PNode* gunFire1;
-		PNode* gunFire2;
+		
+    std::list<MuzzleFlash*> gunFire;
 
 		float bRate;
 		bool bFire;
-		int element;
-
-		Explosion gunFire;
 
 		AimingSystem* aimingSystem;
