Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/targeting_turret.cc

    r9656 r9869  
    2626#include "util/loading/factory.h"
    2727
    28 CREATE_FACTORY(TargetingTurret, CL_TARGETING_TURRET);
     28#include "class_id_DEPRECATED.h"
     29ObjectListDefinitionID(TargetingTurret, CL_TARGETING_TURRET);
     30CREATE_FACTORY(TargetingTurret);
    2931
    3032
    3133TargetingTurret::TargetingTurret(const TiXmlElement* root)
    32   : target(this)
    3334{
    3435  this->init();
     
    4243TargetingTurret::~TargetingTurret ()
    4344{
     45  if(Aim::objectList().exists(target))
     46    delete target;
    4447  // model will be deleted from WorldEntity-destructor
    4548//  delete this->target;
     
    4851void TargetingTurret::init()
    4952{
    50   this->setClassID(CL_TARGETING_TURRET, "TargetingTurret");
     53  this->registerObject(this, TargetingTurret::_objectList);
     54  this->target = new Aim(this);
    5155
    5256  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
     
    7074
    7175  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
    72   this->setProjectileType(CL_GUIDED_MISSILE);
     76  this->setProjectileTypeC("GuidedMissile");
    7377
    7478
     
    7680  //this->getProjectileFactory()->prepare(100);
    7781
    78   this->target.setVisibility(false);
    79   this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
    80   this->target.setRange(1000);
    81   this->target.setAngle(M_PI_4);
    82   this->lockedTarget = &this->target;
     82  this->target->setVisibility(false);
     83  this->target->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
     84  this->target->setRange(1000);
     85  this->target->setAngle(M_PI_4);
     86  this->lockedTarget = this->target;
    8387
    8488  this->lockedTime = 0;
     
    97101  Weapon::loadParams(root);
    98102
    99   LoadParam(root, "target-group", &target, Aim, setTargetGroupS);
     103  LoadParam(root, "target-group", target, Aim, setTargetGroupS);
    100104
    101105}
     
    109113void TargetingTurret::deactivate()
    110114{
    111   this->target.setVisibility(false);
     115  this->target->setVisibility(false);
    112116}
    113117
     
    117121    return;
    118122
    119   this->target.tick(dt);
     123  this->target->tick(dt);
    120124
    121125  if( lockedTime >= neededLockTime )
    122126   {
    123     lockedTarget = this->target.getParent();
     127    lockedTarget = this->target->getParent();
    124128    lockedTime = 0;
    125129   }
    126130
    127131
    128   if(this->target.getParent() == PNode::getNullParent())
     132  if(this->target->getParent() == PNode::getNullParent())
    129133   lockedTime = 0;
    130134  else
Note: See TracChangeset for help on using the changeset viewer.