Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 30, 2013, 3:12:11 PM (11 years ago)
Author:
maxima
Message:

The AIController of the new HumanController is deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc

    r9616 r9617  
    314314    bool Pawn::hasSlaves()
    315315    {
    316                 for (ObjectList<FormationController>::iterator it =
     316        for (ObjectList<FormationController>::iterator it =
    317317                         ObjectList<FormationController>::begin();
    318318                         it != ObjectList<FormationController>::end(); ++it )
     
    327327    Controller* Pawn::getSlave(){
    328328        for (ObjectList<FormationController>::iterator it =
    329                                  ObjectList<FormationController>::begin();
    330                                  it != ObjectList<FormationController>::end(); ++it )
     329                        ObjectList<FormationController>::begin();
     330                        it != ObjectList<FormationController>::end(); ++it )
    331331        {
    332332                if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
     
    360360                        ControllableEntity* entity = slave->getControllableEntity();
    361361
     362                        // delete the AIController
     363                        slave->setControllableEntity(0);
     364
     365
    362366                        // set new Master
    363                                         orxonox_cast<FormationController*>(slave)->takeLeadOfFormation();
     367                                        orxonox_cast<FormationController*>(this->getController())->loseMasterState();
     368
    364369
    365370
     
    368373                         *
    369374                         */
    370                                         //slave->getPlayer()->stopControl();
    371375
    372376                                        // start to control a slave
    373377                                this->getPlayer()->startControl(entity);
     378
     379                                        //orxonox_cast<FormationController*>(this->getController())->takeLeadOfFormation();
     380
    374381                }
    375382                else
Note: See TracChangeset for help on using the changeset viewer.