Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9622


Ignore:
Timestamp:
May 14, 2013, 2:32:37 PM (11 years ago)
Author:
maxima
Message:

Just a few bug fixes.

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

Legend:

Unmodified
Added
Removed
  • code/branches/formationupdate/src/orxonox/controllers/HumanController.cc

    r9256 r9622  
    102102
    103103        // commandslaves when Master of a formation
    104         if (HumanController::localController_s && HumanController::localController_s->state_==MASTER)
     104        if (HumanController::localController_s && HumanController::localController_s->state_==MASTER && FormationController::slaves_.size() > 0)
    105105        {
    106106            if (HumanController::localController_s->formationMode_ != ATTACK)
  • code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc

    r9621 r9622  
    358358                        ControllableEntity* entity = slave->getControllableEntity();
    359359
    360                         // delete the AIController
    361                         slave->setControllableEntity(0);
    362 
    363                         // set a new master within the formation
    364                                         orxonox_cast<FormationController*>(this->getController())->setNewMasterWithinFormation(orxonox_cast<FormationController*>(slave));
    365 
    366                                         // start to control a slave
    367                                 this->getPlayer()->startControl(entity);
     360
     361                        if(!entity->hasHumanController())
     362                        {
     363                                // delete the AIController
     364                                slave->setControllableEntity(0);
     365
     366                                                // set a new master within the formation
     367                                                orxonox_cast<FormationController*>(this->getController())->setNewMasterWithinFormation(orxonox_cast<FormationController*>(slave));
     368
     369                                                // start to control a slave
     370                                                this->getPlayer()->startControl(entity);
     371                        }
     372                        else
     373                        {
     374                                this->getPlayer()->stopControl();
     375                        }
     376
    368377                }
    369378                else
Note: See TracChangeset for help on using the changeset viewer.