Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 23, 2011, 2:13:52 PM (13 years ago)
Author:
willis
Message:

Added Keybinding for toggleFormationFlight

Location:
code/branches/formation/src/orxonox/controllers
Files:
2 edited

Legend:

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

    r8939 r8943  
    5050    SetConsoleCommand("HumanController", "rotatePitch",            &HumanController::rotatePitch   ).addShortcut().setAsInputCommand();
    5151    SetConsoleCommand("HumanController", "rotateRoll",             &HumanController::rotateRoll    ).addShortcut().setAsInputCommand();
    52     SetConsoleCommand("HumanController", "toggleFormationFlight",  &HumanController::toggleFormationFlight).addShortcut().setAsInputCommand();
     52    SetConsoleCommand("HumanController", "toggleFormationFlight",  &HumanController::toggleFormationFlight).addShortcut().keybindMode(KeybindMode::OnPress);
    5353    SetConsoleCommand("HumanController", __CC_fire_name,           &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
    5454    SetConsoleCommand("HumanController", "reload",                 &HumanController::reload        ).addShortcut();
     
    8888        HumanController::localController_s = 0;
    8989        if (this->state_==MASTER)
    90             freeSlaves();
     90            removeFromFormation();
    9191    }
    9292
     
    283283            {
    284284                HumanController::localController_s->takeLeadOfFormation();
    285                 //HumanController::localController_s->state_=MASTER;
    286285            }
    287286        }
  • code/branches/formation/src/orxonox/controllers/Masterable.cc

    r8939 r8943  
    581581    void Masterable::takeLeadOfFormation()
    582582    {
     583        if (!this->getControllableEntity())
     584            return;
     585
    583586        if (this->state_==MASTER) return;
    584587        //search new Master, then take lead
     
    664667        //debug
    665668        if (this->state_==SLAVE)
    666               {orxout(debug_output) << this << " is slave "<< endl;}
    667            else if (this->state_==MASTER)
    668               {orxout(debug_output) << this << " is now a master of "<<this->slaves_.size()<<" slaves."<< endl;}
    669            if (this->state_==FREE)
    670               {orxout(debug_output) << this << " is free "<< endl;}
     669           {orxout(debug_output) << this << " is slave "<< endl;}
     670        else if (this->state_==MASTER)
     671           {orxout(debug_output) << this << " is now a master of "<<this->slaves_.size()<<" slaves."<< endl;}
     672        if (this->state_==FREE)
     673           {orxout(debug_output) << this << " is free "<< endl;}
    671674    }
    672675
Note: See TracChangeset for help on using the changeset viewer.