Index: branches/spaceshipcontrol/src/world_entities/weapons/aim.cc
===================================================================
--- branches/spaceshipcontrol/src/world_entities/weapons/aim.cc	(revision 6605)
+++ branches/spaceshipcontrol/src/world_entities/weapons/aim.cc	(revision 6606)
@@ -101,13 +101,19 @@
 }
 
-void Aim::searchTarget(float range)
+void Aim::searchTarget(float range, float angle)
 {
   std::list<WorldEntity*>::iterator entity;
-
+  Vector diffVec(0.0, 0.0, 0.0);
+  diffVec = ( this->getAbsCoor() - this->source->getAbsCoor() );
+
+//only look for target if the aim hasn`t locked a target yet or if the actual target is out of range 
+  if( this == PNode::getNullParent() || diffVec.len() > range  || ( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle && (this->source->getAbsDirX()).dot(diffVec) > 0))
   for (entity = State::getObjectManager()->getObjectList(OM_GROUP_00).begin();
        entity != State::getObjectManager()->getObjectList(OM_GROUP_00).end();
        entity ++)
   {
-    if (this->source->getAbsCoor().x < (*entity)->getAbsCoor().x && (this->source->getAbsCoor() - (*entity)->getAbsCoor()).len() < range)
+    diffVec = ( (*entity)->getAbsCoor() - this->source->getAbsCoor() );
+
+    if ( diffVec.len() < range  &&  acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) < angle && (this->source->getAbsDirX()).dot(diffVec) > 0)
     {
       if (this->getParent() != (*entity))
@@ -119,4 +125,6 @@
     }
   }
+//if no target found:
+  this->setParent(PNode::getNullParent());
 }
 
@@ -155,6 +163,6 @@
 
 
-  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
-    this->searchTarget(1000);
+//  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
+//    this->searchTarget(1000,M_PI_2);
 //   float z = 0.0f;
 //   glReadPixels ((int)this->getAbsCoor2D().x,
Index: branches/spaceshipcontrol/src/world_entities/weapons/aim.h
===================================================================
--- branches/spaceshipcontrol/src/world_entities/weapons/aim.h	(revision 6605)
+++ branches/spaceshipcontrol/src/world_entities/weapons/aim.h	(revision 6606)
@@ -38,5 +38,5 @@
   inline PNode* getTarget(PNode* target) { return this->getParent(); };
 
-  void searchTarget(float range);
+  void searchTarget(float range, float angle);
 
   void setSize(float size);
Index: branches/spaceshipcontrol/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- branches/spaceshipcontrol/src/world_entities/weapons/aiming_turret.cc	(revision 6605)
+++ branches/spaceshipcontrol/src/world_entities/weapons/aiming_turret.cc	(revision 6606)
@@ -130,5 +130,5 @@
   this->setAbsDirSoft(quat, 5);
 
-  this->target->tick(dt);
+  this->target->searchTarget(100,M_PI_2);
 }
 
@@ -146,5 +146,5 @@
   pj->setAbsDir(this->getAbsDir());
   pj->activate();
-  this->target->searchTarget(100);
+  this->target->searchTarget(100,M_PI_2);
 }
 
Index: branches/spaceshipcontrol/src/world_entities/weapons/targeting_turret.cc
===================================================================
--- branches/spaceshipcontrol/src/world_entities/weapons/targeting_turret.cc	(revision 6605)
+++ branches/spaceshipcontrol/src/world_entities/weapons/targeting_turret.cc	(revision 6606)
@@ -92,5 +92,7 @@
   this->target = new Aim(this);
   this->target->setVisibility(false);
-
+  this->lockedTime = 0;
+  this->neededLockTime = 2;
+  this->lockedTarget->setParent(PNode::getNullParent());
   this->loadModel("models/guns/turret2.obj");
 
@@ -119,6 +121,17 @@
 void TargetingTurret::tick(float dt)
 {
+  if( lockedTime >= neededLockTime )
+   {
+    lockedTarget = this->target->getParent();
+    lockedTime = 0;
+   }
 
   this->target->tick(dt);
+
+  if(this->target->getParent() == PNode::getNullParent())
+   lockedTime = 0;
+  else
+   lockedTime += dt;
+
 }
 
@@ -137,5 +150,5 @@
   pj->setAbsDir(this->getAbsDir());
   pj->activate();
-  this->target->searchTarget(100);
+  this->target->searchTarget(100,M_PI_2);
 }
 
Index: branches/spaceshipcontrol/src/world_entities/weapons/targeting_turret.h
===================================================================
--- branches/spaceshipcontrol/src/world_entities/weapons/targeting_turret.h	(revision 6605)
+++ branches/spaceshipcontrol/src/world_entities/weapons/targeting_turret.h	(revision 6606)
@@ -32,6 +32,9 @@
 
   private:
-    Aim*          target;
-  };
+    Aim*           target;
+    PNode*         lockedTarget;
+    float          lockedTime;
+    float          neededLockTime;
+  }; 
 
 #endif /* _TARGETING_TURRET_H */
