Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2010, 4:18:12 PM (14 years ago)
Author:
solex
Message:

master now lists slaves

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai/src/orxonox/controllers/AIController.cc

    r6683 r6695  
    5050    {
    5151        if (this->state_ == MASTER) freeAllSlaves();
     52        if (this->state_ == SLAVE) unregisterSlave();
     53        this->slaves.clear();
    5254    }
    5355
     
    6062        {
    6163
     64            //this->state_ = MASTER;
    6265            // search master
    63             random = rnd(maxrand);
    64             if (random < 50 && (!this->target_))
     66            //random = rnd(maxrand);
     67            //if (random < 101 && (!this->target_))
    6568                this->searchNewMaster();
    66 
    67 
    6869
    6970        }
     
    7879            // command slaves
    7980            this->commandSlaves();
     81
    8082            // search enemy
    8183            random = rnd(maxrand);
     
    130132                this->aimAtTarget();
    131133
    132             /*if (this->bHasTargetPosition_)
     134            if (this->bHasTargetPosition_)
    133135                this->moveToTargetPosition();
    134 */
     136
    135137            if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
    136138                this->getControllableEntity()->fire(0);
    137139        }
    138140
    139         if (this->state_==SLAVE)
     141        if (this->state_ == SLAVE)
    140142        {
    141143
Note: See TracChangeset for help on using the changeset viewer.