Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9617


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

The AIController of the new HumanController is deleted.

Location:
code/branches/formationupdate/src/orxonox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/formationupdate/src/orxonox/controllers/Controller.h

    r8706 r9617  
    6565            virtual void changedControllableEntity() {}
    6666
    67         protected:
    6867            // don't use this directly, use getPlayer()->startControl(entity) (unless you know exactly what you do)
    6968            inline void setControllableEntity(ControllableEntity* entity)
  • code/branches/formationupdate/src/orxonox/controllers/FormationController.h

    r9616 r9617  
    6060      static void formationsize(const int size);
    6161      void takeLeadOfFormation();
     62      void loseMasterState();
    6263
    6364      inline void setFormationFlight(bool formation)
     
    136137      void freeSlaves();
    137138      void forceFreeSlaves();
    138       void loseMasterState();
    139139      void forceFreedom();
    140140      bool forcedFree();
  • code/branches/formationupdate/src/orxonox/controllers/HumanController.h

    r9256 r9617  
    102102            //friend class, for mouselook
    103103            friend class Map;
     104            static HumanController* localController_s;
    104105
    105106        protected:
    106             static HumanController* localController_s;
    107107            bool controlPaused_;
    108108
  • 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.