Index: trunk/src/world_entities/weapons/aim.cc
===================================================================
--- trunk/src/world_entities/weapons/aim.cc	(revision 9406)
+++ trunk/src/world_entities/weapons/aim.cc	(revision 9656)
@@ -50,7 +50,4 @@
 Aim::~Aim ()
 {
-  if (this->material)
-    delete this->material;
-
 /*  if (this->text != NULL)
     delete this->text;*/
@@ -70,10 +67,9 @@
 
   this->setBindNode(this);
-  this->material = new Material;
   this->source = NULL;
 
-  this->range = 10000;
+  this->range = 1000;
   this->angle = M_PI_4;
-  this->group = OM_GROUP_01;
+  this->targetGroup = OM_GROUP_01;
   this->anim = new tAnimation<Aim>(this, &Aim::setSize);
   this->anim->setInfinity(ANIM_INF_CONSTANT);
@@ -103,4 +99,6 @@
   LoadParam(root, "rotation-speed", this, Aim, setRotationSpeed)
       .describe("the Speed with which the Aim should rotate");
+
+  LoadParam(root, "target-group", this, Aim, setTargetGroupS);
 }
 
@@ -108,15 +106,16 @@
 {
   ObjectManager::EntityList::iterator entity;
-
-  for (entity = State::getObjectManager()->getObjectList(group).begin();
-       entity != State::getObjectManager()->getObjectList(group).end();
+  //printf("%d\n", this->targetGroup);
+  for (entity = State::getObjectManager()->getObjectList(this->targetGroup).begin();
+       entity != State::getObjectManager()->getObjectList(this->targetGroup).end();
        entity ++)
   {
     diffVec = ( (*entity)->getAbsCoor() - this->source->getAbsCoor() );
 
-    if ( diffVec.len() < range &&  acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) )  < angle)
+    if ( diffVec.len() < range )//&&  acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) )  < angle)
     {
       //if (this->getParent() != (*entity))
       {
+        printf("found target::: %d %s::%s\n", (*entity)->getOMListNumber(), (*entity)->getClassCName(), (*entity)->getCName());
         this->anim->replay();
         this->setParentSoft(*entity, 5);
@@ -128,9 +127,14 @@
    //if no target found:
    this->setParent(PNode::getNullParent());
-
-
-
-}
-
+}
+
+void Aim::setTargetGroupS(const std::string& groupName)
+{
+  OM_LIST id = ObjectManager::StringToOMList(groupName);
+  if (id != OM_NULL)
+    this->setTargetGroup(id);
+  else
+    PRINTF(2)("List %s not found for targetting\n", groupName.c_str());
+}
 
 /**
@@ -149,5 +153,5 @@
 void Aim::setTexture(const std::string& textureFile)
 {
-  this->material->setDiffuseMap(textureFile);
+  this->material.setDiffuseMap(textureFile);
 }
 
@@ -170,6 +174,6 @@
 //only look for target if the aim hasn`t locked a target yet or if the actual target is out of range
    if(this->getParent() == PNode::getNullParent() ||
-      diffVec.len() > range  ||
-     ( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
+      diffVec.len() > range )// ||
+     //( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
     {
      this->setParentSoft(PNode::getNullParent(),5);
@@ -213,5 +217,5 @@
 
   glRotatef(this->getAbsDir2D(), 0,0,1);
-  this->material->select();
+  this->material.select();
   glBegin(GL_TRIANGLE_STRIP);
   glTexCoord2f(0, 0);
Index: trunk/src/world_entities/weapons/aim.h
===================================================================
--- trunk/src/world_entities/weapons/aim.h	(revision 9406)
+++ trunk/src/world_entities/weapons/aim.h	(revision 9656)
@@ -11,8 +11,9 @@
 #include "object_manager.h"
 
+#include "material.h"
+
 // FORWARD DECLARATION
 class Model;
 class Text;
-class Material;
 class TiXmlElement;
 template<class T> class tAnimation;
@@ -25,11 +26,11 @@
  * Also the Aim is a Element2D, as it draws a cross onto the Target.
  */
-class Aim : public PNode, public Element2D {
+class Aim : public PNode, public Element2D
+{
 
- public:
+public:
   Aim(PNode* source, const TiXmlElement* root = NULL);
   virtual ~Aim();
 
-  void init();
   virtual void loadParams(const TiXmlElement* root);
 
@@ -37,11 +38,12 @@
 
   inline void selectTarget(PNode* target) { this->setParent(target); };
-  inline PNode* getTarget(PNode* target) { return this->getParent(); };
+  inline PNode* getTarget(PNode* target) const { return this->getParent(); };
 
   void searchTarget();
 
-  void setRange(float range){this->range = range;};
-  void setAngle(float angle){this->angle = angle;};
-  void setGroup(OM_LIST group){this->group = group;};
+  void setRange(float range) {this->range = range;};
+  void setAngle(float angle) {this->angle = angle;};
+  void setTargetGroup(OM_LIST group) { this->targetGroup = group; };
+  void setTargetGroupS(const std::string& grounName);
 
   void setSize(float size);
@@ -53,17 +55,21 @@
   virtual void draw() const;
 
- private:
-   Material*        material;             //!< a material for the Aim.
-   float            rotationSpeed;        //!< Speed of the Rotation.
-   tAnimation<Aim>* anim;
+private:
+  void init();
 
-   float            range;                //!<
-   float            angle;                //!<
-   Vector           diffVec;
-   OM_LIST          group;
 
-   PNode*           source;               //!< Where this Shot has come from.
+private:
+  Material         material;             //!< a material for the Aim.
+  float            rotationSpeed;        //!< Speed of the Rotation.
+  tAnimation<Aim>* anim;
 
-   Text*            text;                 //!< A Text to display onto this Node. (distance to Target)
+  float            range;                //!<
+  float            angle;                //!<
+  Vector           diffVec;
+  OM_LIST          targetGroup;
+
+  PNode*           source;               //!< Where this Shot has come from.
+
+  //   Text             text;                 //!< A Text to display onto this Node. (distance to Target)
 };
 
Index: trunk/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/aiming_turret.cc	(revision 9406)
+++ trunk/src/world_entities/weapons/aiming_turret.cc	(revision 9656)
@@ -38,5 +38,5 @@
 */
 AimingTurret::AimingTurret ()
-  : Weapon()
+    : Weapon(), target(this)
 {
   this->init();
@@ -46,4 +46,5 @@
 
 AimingTurret::AimingTurret(const TiXmlElement* root)
+    : target(this)
 {
   this->init();
@@ -58,5 +59,5 @@
 {
   // model will be deleted from WorldEntity-destructor
-//  delete this->target;
+  //  delete this->target;
 }
 
@@ -91,8 +92,8 @@
   //this->getProjectileFactory()->prepare(100);
 
-  this->target = new Aim(this);
-  this->target->setVisibility(false);
-  this->target->setRange(400);
-  this->target->setAngle(M_PI_2);
+  this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
+  this->target.setVisibility(false);
+  this->target.setRange(400);
+  this->target.setAngle(M_PI_2);
 
   this->setActionSound(WA_SHOOT, "sound/explosions/explosion_3.wav");
@@ -110,10 +111,10 @@
 void AimingTurret::activate()
 {
-  this->target->setVisibility(true);
+  this->target.setVisibility(true);
 }
 
 void AimingTurret::deactivate()
 {
-  this->target->setVisibility(false);
+  this->target.setVisibility(false);
 }
 
@@ -123,16 +124,18 @@
     return;
   Quaternion quat;
-  Vector direction = this->target->getAbsCoor() - this->getAbsCoor();
+  Vector direction = this->target.getAbsCoor() - this->getAbsCoor();
 
   direction.normalize();
 
   if (likely (this->getParent() != NULL))
-    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+    //quat = Quaternion(direction, this->getParent()->getAbsDirY()) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+    quat = Quaternion ( M_PI_2, this->getParent()->getAbsDirY()) * Quaternion::lookAt(this->getAbsCoor(), this->target.getAbsCoor(), this->getParent()->getAbsDirY());
   else
-    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+    //quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+    quat = Quaternion ( M_PI_2, Vector(0,1,0)) * Quaternion::lookAt(this->getAbsCoor(), this->target.getAbsCoor(), Vector(0,1,0));
 
   this->setAbsDirSoft(quat, 5);
 
-  this->target->tick(dt);
+  this->target.tick(dt);
 }
 
@@ -143,6 +146,6 @@
     return;
 
-  pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(13)
-            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
+  pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDirX()*250.0 + VECTOR_RAND(4)
+                                          /*target.getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
 
   pj->setParent(PNode::getNullParent());
Index: trunk/src/world_entities/weapons/aiming_turret.h
===================================================================
--- trunk/src/world_entities/weapons/aiming_turret.h	(revision 9406)
+++ trunk/src/world_entities/weapons/aiming_turret.h	(revision 9656)
@@ -8,30 +8,33 @@
 
 #include "weapon.h"
-
+#include "aim.h"
 /* FORWARD DECLARATION */
-class Aim;
 
 class AimingTurret : public Weapon
-  {
-  public:
-    AimingTurret ();
-    AimingTurret(const TiXmlElement* root);
-    virtual ~AimingTurret ();
+{
+public:
+  AimingTurret ();
+  AimingTurret(const TiXmlElement* root);
+  virtual ~AimingTurret ();
 
-    void init();
-    virtual void loadParams(const TiXmlElement* root);
+  virtual void loadParams(const TiXmlElement* root);
 
-    virtual void activate();
-    virtual void deactivate();
+  void setTargetGroup(OM_LIST targetGroup) { this->target.setTargetGroup(targetGroup); };
 
-    virtual void tick(float dt);
-    virtual void fire();
+  virtual void activate();
+  virtual void deactivate();
+
+  virtual void tick(float dt);
+  virtual void fire();
 
 
-    virtual void draw() const;
+  virtual void draw() const;
 
-  private:
-    Aim*          target;
-  };
+private:
+  void init();
+
+private:
+  Aim           target;
+};
 
 #endif /* _AIMING_TURRET_H */
Index: trunk/src/world_entities/weapons/laser_cannon.cc
===================================================================
--- trunk/src/world_entities/weapons/laser_cannon.cc	(revision 9406)
+++ trunk/src/world_entities/weapons/laser_cannon.cc	(revision 9656)
@@ -121,4 +121,7 @@
     return;
 
+  // make this to let the onKill(...) fuction get the stuff
+  pj->setOwner(this->getOwner());
+
   pj->setParent(PNode::getNullParent());
 
Index: trunk/src/world_entities/weapons/targeting_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/targeting_turret.cc	(revision 9406)
+++ trunk/src/world_entities/weapons/targeting_turret.cc	(revision 9656)
@@ -17,7 +17,5 @@
 #include "targeting_turret.h"
 
-#include "weapon_manager.h"
-#include "aim.h"
-#include "world_entities/projectiles/projectile.h"
+#include "projectiles/projectile.h"
 
 #include "model.h"
@@ -25,4 +23,5 @@
 #include "animation3d.h"
 
+#include "util/loading/load_param.h"
 #include "util/loading/factory.h"
 
@@ -30,20 +29,6 @@
 
 
-
-
-/**
- *  standard constructor
-
-   creates a new weapon
-*/
-TargetingTurret::TargetingTurret ()
-  : Weapon()
-{
-  this->init();
-
-}
-
-
 TargetingTurret::TargetingTurret(const TiXmlElement* root)
+  : target(this)
 {
   this->init();
@@ -91,9 +76,9 @@
   //this->getProjectileFactory()->prepare(100);
 
-  this->target = new Aim(this);
-  this->target->setVisibility(false);
-  this->target->setRange(1000);
-  this->target->setAngle(M_PI_4);
-  this->lockedTarget = this->target;
+  this->target.setVisibility(false);
+  this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
+  this->target.setRange(1000);
+  this->target.setAngle(M_PI_4);
+  this->lockedTarget = &this->target;
 
   this->lockedTime = 0;
@@ -112,4 +97,6 @@
   Weapon::loadParams(root);
 
+  LoadParam(root, "target-group", &target, Aim, setTargetGroupS);
+
 }
 
@@ -122,5 +109,5 @@
 void TargetingTurret::deactivate()
 {
-  this->target->setVisibility(false);
+  this->target.setVisibility(false);
 }
 
@@ -130,13 +117,14 @@
     return;
 
+  this->target.tick(dt);
+
   if( lockedTime >= neededLockTime )
    {
-    lockedTarget = this->target->getParent();
+    lockedTarget = this->target.getParent();
     lockedTime = 0;
    }
 
-  this->target->tick(dt);
 
-  if(this->target->getParent() == PNode::getNullParent())
+  if(this->target.getParent() == PNode::getNullParent())
    lockedTime = 0;
   else
@@ -159,5 +147,4 @@
   pj->setAbsDir(this->getAbsDir());
   pj->activate();
-
 }
 
Index: trunk/src/world_entities/weapons/targeting_turret.h
===================================================================
--- trunk/src/world_entities/weapons/targeting_turret.h	(revision 9406)
+++ trunk/src/world_entities/weapons/targeting_turret.h	(revision 9656)
@@ -8,32 +8,34 @@
 
 #include "weapon.h"
-
-/* FORWARD DECLARATION */
-class Aim;
+#include "aim.h"
 
 class TargetingTurret : public Weapon
-  {
-  public:
-    TargetingTurret ();
-    TargetingTurret(const TiXmlElement* root);
-    virtual ~TargetingTurret ();
+{
+public:
+  TargetingTurret(const TiXmlElement* root = NULL);
+  virtual ~TargetingTurret ();
 
-    void init();
-    virtual void loadParams(const TiXmlElement* root);
+  virtual void loadParams(const TiXmlElement* root);
 
-    virtual void activate();
-    virtual void deactivate();
+  virtual void activate();
+  virtual void deactivate();
 
-    virtual void tick(float dt);
-    virtual void fire();
+  virtual void tick(float dt);
+  virtual void fire();
 
-    virtual void draw() const;
+  virtual void draw() const;
 
-  private:
-    Aim*           target;
-    PNode*         lockedTarget;
-    float          lockedTime;
-    float          neededLockTime;
-  };
+  void setTargetGroup(OM_LIST targetGroup) { this->target.setTargetGroup(targetGroup); };
+  const PNode* getLockedTarget() const { return lockedTarget; };
+
+private:
+  void init();
+
+private:
+  Aim            target;
+  PNode*         lockedTarget;
+  float          lockedTime;
+  float          neededLockTime;
+};
 
 #endif /* _TARGETING_TURRET_H */
Index: trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- trunk/src/world_entities/weapons/test_gun.cc	(revision 9406)
+++ trunk/src/world_entities/weapons/test_gun.cc	(revision 9656)
@@ -177,4 +177,7 @@
   if (pj == NULL)
     return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
 
   pj->setParent(PNode::getNullParent());
