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/npcs/space_turret.cc

    r9656 r9869  
    2929#include "effects/explosion.h"
    3030
    31 CREATE_FACTORY(SpaceTurret, CL_SPACE_TURRET);
     31#include "class_id_DEPRECATED.h"
     32ObjectListDefinitionID(SpaceTurret, CL_SPACE_TURRET);
     33CREATE_FACTORY(SpaceTurret);
    3234
    3335/**
     
    3638 */
    3739SpaceTurret::SpaceTurret(const TiXmlElement* root)
    38   : NPC(root)
     40    : NPC(root)
    3941{
    4042  this->init();
     
    4850 */
    4951SpaceTurret::~SpaceTurret ()
    50 {
    51 
    52 }
     52{}
    5353
    5454
     
    5959void SpaceTurret::init()
    6060{
    61   this->setClassID(CL_SPACE_TURRET, "SpaceTurret");
     61  this->registerObject(this, SpaceTurret::_objectList);
    6262  this->loadModel("models/ground_turret_#.obj", 7.5);
    6363  this->loadModel("models/comet.obj", 1.0f, 3);
     
    9898
    9999  element = root->FirstChildElement("weapon-left");
    100   if (element != NULL) element = element->FirstChildElement();
    101   this->left = dynamic_cast<Weapon*>( Factory::fabricate( element) );
     100  if (element != NULL)
     101    element = element->FirstChildElement();
     102  if (element != NULL)
     103    this->left = dynamic_cast<Weapon*>( Factory::fabricate( element) );
    102104  if (this->left)
    103105  {
     
    112114
    113115  element = root->FirstChildElement("weapon-right");
    114   if (element != NULL)  if (element != NULL) element = element->FirstChildElement();
    115   this->right = dynamic_cast<Weapon*>( Factory::fabricate( element) );
     116  if (element != NULL)
     117    element = element->FirstChildElement();
     118  if (element != NULL)
     119    this->right = dynamic_cast<Weapon*>( Factory::fabricate( element) );
    116120  if (this->right)
    117121  {
     
    132136 */
    133137void SpaceTurret::setWeaponLeft(const std::string& wLeft)
    134 {
    135 
    136 }
     138{}
    137139
    138140/**
     
    150152{
    151153  if(this->getHealth() > 0.0f && State::getPlayer() &&
    152      State::getPlayer()->getPlayable() &&
    153      State::getPlayer()->getPlayable()->distance(this) < 300) // HACK
    154   {
    155   if (likely(this->left != NULL))
    156   {
    157 //    this->left->tickW(dt);
    158     this->left->requestAction(WA_SHOOT);
    159   }
    160   if (likely(this->right != NULL))
    161   {
    162 //    this->right->tickW(dt);
    163     this->right->requestAction(WA_SHOOT);
    164   }
     154      State::getPlayer()->getPlayable() &&
     155      State::getPlayer()->getPlayable()->distance(this) < 300) // HACK
     156  {
     157    if (likely(this->left != NULL))
     158    {
     159      //    this->left->tickW(dt);
     160      this->left->requestAction(WA_SHOOT);
     161    }
     162    if (likely(this->right != NULL))
     163    {
     164      //    this->right->tickW(dt);
     165      this->right->requestAction(WA_SHOOT);
     166    }
    165167  }
    166168}
     
    183185    this->getModel(3)->draw();
    184186  glPopMatrix();
    185 /*
    186   if (this->left != NULL)
    187     this->left->draw();
    188   if (this->right != NULL)
    189     this->right->draw();*/
     187  /*
     188    if (this->left != NULL)
     189      this->left->draw();
     190    if (this->right != NULL)
     191      this->right->draw();*/
    190192}
    191193
     
    197199 */
    198200void SpaceTurret::postSpawn ()
    199 {
    200 
    201 }
     201{}
    202202
    203203/**
     
    206206 */
    207207void SpaceTurret::leftWorld ()
    208 {
    209 
    210 }
     208{}
    211209
    212210void SpaceTurret::destroy(WorldEntity* killer)
Note: See TracChangeset for help on using the changeset viewer.