Index: branches/presentation/src/world_entities/npcs/adm_turret.cc
===================================================================
--- branches/presentation/src/world_entities/npcs/adm_turret.cc	(revision 10702)
+++ branches/presentation/src/world_entities/npcs/adm_turret.cc	(revision 10703)
@@ -25,4 +25,5 @@
 
 #include "environments/bsp_entity.h"
+#include "effects/explosion.h"
 
 ObjectListDefinition(AdmTurret);
@@ -68,8 +69,6 @@
 			.describe("The filename of the World Entity, that is to be shot at")
 			.defaultValues("");
-                
-                LoadParam(root, "type", this, AdmTurret, setType)
-                        .describe("floor|ceil"); 
-
+    LoadParam(root, "type", this, AdmTurret, setType)
+      .describe("floor|ceil"); 
 		LoadParamXML(root, "Cannons", this, AdmTurret, addCannons)
   			.describe("add cannons to ADM");
@@ -78,5 +77,4 @@
 		LoadParamXML(root, "Weapon", this, AdmTurret, addWeapon)
   			.describe("add weapon to ADM");
-
 	}
 //         this->removeNodeFlags( PNODE_ALL );
@@ -134,5 +132,6 @@
 {
 	this->registerObject(this, AdmTurret::_objectList);
-        
+        this->setHealthMax(100);
+        this->setHealth(100);
         this->bodyAngle = this->cannonAngle = 0.0f;
         this->isActive = true;
@@ -149,29 +148,41 @@
   WorldEntity::tick(dt);
   if (this->weapon) this->weapon->fire(false);
-  this->updatePlayerVisible();
-
-  //rotate sensor 2PI/sec
-  this->sensor->setAbsDir( this->sensor->getAbsDir() * Quaternion( PI*2*dt, Vector( 0, -1, 0 ) ) );
-
-
-  Vector playerPos = this->myTarget->getAbsCoor() + Vector(0, 12, 0);
-  Vector ds = playerPos - ( this->cannons->getAbsCoor() );
-  if ( isActive && ds.len() <= range && playerVisible )
-  {
-    this->moveTowards( ds,  dt);
+  if ( this->getHealth() <= 0 )
+  {
+    this->moveTowards( Vector(0, -1, 0), dt*2 );
+  }
+  else
+  {
+  
     
-    //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->updatePlayerVisible();
+  
+    //rotate sensor 2PI/sec
+    this->sensor->setAbsDir( this->sensor->getAbsDir() * Quaternion( PI*2*dt, Vector( 0, -1, 0 ) ) );
+  
+  
+    Vector playerPos = this->myTarget->getAbsCoor() + Vector(0, 12, 0);
+    Vector ds = playerPos - ( this->cannons->getAbsCoor() );
+    if ( isActive && ds.len() <= range && playerVisible )
     {
-     	if (this->weapon) this->weapon->fire(true);
+      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)
+      {
+        if (this->weapon) this->weapon->fire(true);
+      }
     }
-  }
-  else
-    this->moveTowards( Vector(0, -1, 0), dt );
+    else
+    {
+      if ( !( isActive && ds.len() <= range ) )
+        this->moveTowards( Vector(0, -1, 0), dt );
+    }
+  }
 }
 
@@ -237,8 +248,6 @@
 	//this->cannons->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
 	//this->cannons->addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
-	
+
 	this->cannons->toList( getOMListNumber() );
-
-
 }
 
@@ -270,13 +279,13 @@
     this->cannons->setParent( NullParent::getNullParent() );
     this->cannons->shiftCoor( this->getAbsCoor() );
-    
+
     this->sensor->setParent( NullParent::getNullParent() );
     this->sensor->shiftCoor( this->getAbsCoor() );
   }
-  
+
   targetDir.normalize();
-  
+
   float dAngle = dt;
-  
+
   float bestResult = -1.0f;
   Quaternion bestBodyRot;
@@ -284,5 +293,5 @@
   float bestBodyAngle = 0.0f;
   float bestCannonAngle = 0.0f;
-  
+
    Quaternion baseRot(0, Vector(1, 0, 0));
    if ( isCeil )
@@ -290,5 +299,5 @@
      baseRot = Quaternion( PI, Vector( 1, 0, 0 ) );
    }
-  
+
   for ( int dBodyAngle = -1; dBodyAngle<2; dBodyAngle++ )
   {
@@ -297,5 +306,5 @@
       float bodyAngle = this->bodyAngle + dBodyAngle*dAngle;
       float cannonAngle = this->cannonAngle + dCannonAngle*dAngle;
-      
+
       while ( bodyAngle > 2*PI )
         bodyAngle -= 2*PI;
@@ -306,13 +315,13 @@
       while ( cannonAngle < 0 )
         cannonAngle += 2*PI;
-      
+
       Quaternion bodyRot( bodyAngle, Vector( 0, 1, 0 ) );
       Quaternion cannonRot( cannonAngle, Vector( 0, 0, 1) );
-      
+
        bodyRot = baseRot * bodyRot;
        cannonRot = baseRot * cannonRot;
-      
+
       float result = (bodyRot * cannonRot).apply( Vector( -1, 0, 0 ) ).dot( targetDir );
-      
+
       if ( result > bestResult )
       {
@@ -325,8 +334,8 @@
     }
   }
-  
+
   this->bodyAngle = bestBodyAngle;
   this->cannonAngle = bestCannonAngle;
-  
+
   this->setAbsDir( bestBodyRot );
   this->cannons->setAbsDir( bestBodyRot * bestCannonRot );
@@ -338,6 +347,5 @@
   // for all bsp managers check all entities
   Vector pos = this->cannons->getAbsCoor();
-  Vector dir = this->myTarget->getAbsCoor() - pos;
-
+  Vector dir = this->myTarget->getAbsCoor() - pos  + Vector(0, 12, 0);
 
   this->playerVisible = true;
@@ -346,7 +354,11 @@
        bspIterator++) {
       float res = (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollisionRay( pos, dir, dir.len() + 1 );
-      
-      if ( res < dir.len() )
-        this->playerVisible = false;
-  }
-}
+
+      if ( res < dir.len() ) this->playerVisible = false;
+  }
+}
+
+void AdmTurret::destroy( WorldEntity * killer )
+{
+  Explosion().explode(this->cannons,Vector(1,1,1));
+}
Index: branches/presentation/src/world_entities/npcs/adm_turret.h
===================================================================
--- branches/presentation/src/world_entities/npcs/adm_turret.h	(revision 10702)
+++ branches/presentation/src/world_entities/npcs/adm_turret.h	(revision 10703)
@@ -12,4 +12,5 @@
 #include "world_entity.h"
 #include "weapons/bsp_weapon.h"
+
 
 class AdmTurret : public WorldEntity
@@ -32,4 +33,6 @@
                    
                    virtual void setTarget(const std::string& target);
+                   
+                   virtual void destroy(WorldEntity* killer);
                    
       private:
