Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10615 in orxonox.OLD for branches/cleanup/src/ai/swarm_wait.cc


Ignore:
Timestamp:
Mar 30, 2007, 12:01:21 PM (18 years ago)
Author:
rennerc
Message:

this might fix the/one segfault bug in AI. cannot verify it because cannot reproduce bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cleanup/src/ai/swarm_wait.cc

    r10555 r10615  
    1919void SwarmWait::process(float dt)
    2020{
    21         if(taskRelObject!=NULL){
    22                 Vector distVect=taskRelObject->getAbsCoor()-getSwarmPosition();
    23                 float distance=distVect.len();
    24                 if(distance<attackDistance+100)taskComplete=true;               //### change wakeup distance here
     21        if(taskRelObjectName!=""){
     22          WorldEntity* taskRelObject = dynamic_cast<WorldEntity*>(WorldEntity::objectList().getBaseObject( taskRelObjectName ));
     23          Vector distVect=taskRelObject->getAbsCoor()-getSwarmPosition();
     24          float distance=distVect.len();
     25          if(distance<attackDistance+100)taskComplete=true;             //### change wakeup distance here
    2526        }
    2627
Note: See TracChangeset for help on using the changeset viewer.