Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9612 in orxonox.OLD for branches/proxy/src/world_entities/npcs


Ignore:
Timestamp:
Jul 30, 2006, 12:04:42 PM (18 years ago)
Author:
bensch
Message:

new range

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/world_entities/npcs/network_turret.cc

    r9611 r9612  
    109109void NetworkTurret::tick(float dt)
    110110{
    111   if(this->getHealth() > 0.0f
    112     ) // HACK <--- YOU ARE THE MOTHERFUCKER
     111  ObjectManager::EntityList::iterator entity;
     112  Vector diffVec;
     113  for (entity = State::getObjectManager()->getObjectList((OM_LIST)this->targetGroup).begin();
     114       entity != State::getObjectManager()->getObjectList((OM_LIST)this->targetGroup).end();
     115       entity ++)
    113116  {
    114     if (likely(this->weapon != NULL))
     117    diffVec = ( (*entity)->getAbsCoor() - this->getAbsCoor() );
     118
     119    if ( diffVec.len() < 1000 )//&&  acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) )  < angle)
    115120    {
    116       //    this->left->tickW(dt);
    117       this->weapon->requestAction(WA_SHOOT);
     121      //if (this->getParent() != (*entity))
     122      {
     123        printf("found target::: %d %s::%s\n", (*entity)->getOMListNumber(), (*entity)->getClassCName(), (*entity)->getCName());
     124
     125        this->weapon->requestAction(WA_SHOOT);
     126        return;
     127      }
    118128    }
    119129  }
Note: See TracChangeset for help on using the changeset viewer.