Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7863 for code/trunk/src


Ignore:
Timestamp:
Feb 12, 2011, 1:09:42 PM (14 years ago)
Author:
landauf
Message:

disabled suicide for Spectator

Location:
code/trunk/src/orxonox
Files:
2 edited

Legend:

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

    r7862 r7863  
    4141{
    4242    extern const std::string __CC_fire_name = "fire";
     43    extern const std::string __CC_suicide_name = "suicide";
    4344
    4445    SetConsoleCommand("HumanController", "moveFrontBack",          &HumanController::moveFrontBack ).addShortcut().setAsInputCommand();
     
    5455    SetConsoleCommand("HumanController", "switchCamera",           &HumanController::switchCamera  ).addShortcut();
    5556    SetConsoleCommand("HumanController", "mouseLook",              &HumanController::mouseLook     ).addShortcut();
    56     SetConsoleCommand("HumanController", "suicide",                &HumanController::suicide       ).addShortcut();
     57    SetConsoleCommand("HumanController", __CC_suicide_name,        &HumanController::suicide       ).addShortcut();
    5758    SetConsoleCommand("HumanController", "toggleGodMode",          &HumanController::toggleGodMode ).addShortcut();
    5859    SetConsoleCommand("HumanController", "addBots",                &HumanController::addBots       ).addShortcut().defaultValues(1);
  • code/trunk/src/orxonox/worldentities/pawns/Spectator.cc

    r7862 r7863  
    4343{
    4444    extern const std::string __CC_fire_name;
     45    extern const std::string __CC_suicide_name;
    4546
    4647    CreateFactory(Spectator);
     
    154155
    155156    /**
    156         @brief Changes the keybind mode of the fire command to OnPress.
     157        @brief Changes the behavior of some console commands.
    157158    */
    158159    void Spectator::startLocalHumanControl()
     
    162163        // change keybind mode of fire command to OnPress to avoid firing after respawn
    163164        ModifyConsoleCommand(__CC_fire_name).keybindMode(KeybindMode::OnPress);
     165
     166        // disable suicide
     167        ModifyConsoleCommand(__CC_suicide_name).pushFunction(&prototype::void__void);
    164168    }
    165169
    166170    /**
    167         @brief Changes the keybind mode of the fire command back to OnHold.
     171        @brief Changes the behavior of some console commands back to the original state.
    168172    */
    169173    void Spectator::stopLocalHumanControl()
     
    174178        // as soon as the player releases and presses the button again, the helper function will be called which changes the keybind mode back to OnHold
    175179        ModifyConsoleCommand(__CC_fire_name).pushFunction(&Spectator::resetFireCommand).keybindMode(KeybindMode::OnPress);
     180
     181        // enable suicide
     182        ModifyConsoleCommand(__CC_suicide_name).popFunction();
    176183    }
    177184
Note: See TracChangeset for help on using the changeset viewer.