Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2005, 4:16:51 PM (18 years ago)
Author:
patrick
Message:

network: merged the trunk into the network with the command svn merge -r5824:HEAD ../trunk network, changes changed… bla bla..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/weapons/weapon_manager.cc

    r5779 r5968  
    110110  this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
    111111  this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
    112 
    113   this->targetIterator = NULL;
    114112}
    115113
     
    337335    }
    338336  }
    339 }
    340 
    341 
    342 /**
    343  * Selects an Entity from the NPC-list, and returns the Target
    344  */
    345 PNode* WeaponManager::getSomeTarget()
    346 {
    347    if (this->targetIterator == NULL)
    348    {
    349      std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);
    350      if (npcList != NULL)
    351      {
    352        this->targetIterator = npcList->begin();
    353      }
    354      else
    355        return NULL;
    356    }
    357 
    358    ///FIXME
    359 //   this->targetIterator++;
    360    PNode* retNode = dynamic_cast<PNode*>((*targetIterator));
    361 //   if (retNode == NULL && this->targetIterator->getList()->getSize() > 0)
    362 //     retNode =  dynamic_cast<PNode*>(targetIterator->firstElement());
    363 
    364    return retNode;
    365 }
    366 
    367 
    368 /**
    369  * Selects an Entity from the Entity-List, that is near of the carrier PNode.
    370  * @param carrier: The PNode from which the distance should be measured
    371  * @param distance: The Maximum Distance to Return.
    372  */
    373 PNode* WeaponManager::getDistanceTarget(const PNode* carrier, float distance)
    374 {
    375   std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);
    376   if (npcList != NULL)
    377   {
    378     list<BaseObject*>::iterator node;
    379     for (node= npcList->begin(); node != npcList->end(); node++)
    380       if ((carrier->getAbsCoor() - dynamic_cast<PNode*>(*node)->getAbsCoor()).len() < distance)
    381         return dynamic_cast<PNode*>(*node);
    382   }
    383   return this->getFixedTarget();
    384337}
    385338
Note: See TracChangeset for help on using the changeset viewer.