Changeset 7863 for code/trunk
- Timestamp:
- Feb 12, 2011, 1:09:42 PM (14 years ago)
- Location:
- code/trunk/src/orxonox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/controllers/HumanController.cc
r7862 r7863 41 41 { 42 42 extern const std::string __CC_fire_name = "fire"; 43 extern const std::string __CC_suicide_name = "suicide"; 43 44 44 45 SetConsoleCommand("HumanController", "moveFrontBack", &HumanController::moveFrontBack ).addShortcut().setAsInputCommand(); … … 54 55 SetConsoleCommand("HumanController", "switchCamera", &HumanController::switchCamera ).addShortcut(); 55 56 SetConsoleCommand("HumanController", "mouseLook", &HumanController::mouseLook ).addShortcut(); 56 SetConsoleCommand("HumanController", "suicide",&HumanController::suicide ).addShortcut();57 SetConsoleCommand("HumanController", __CC_suicide_name, &HumanController::suicide ).addShortcut(); 57 58 SetConsoleCommand("HumanController", "toggleGodMode", &HumanController::toggleGodMode ).addShortcut(); 58 59 SetConsoleCommand("HumanController", "addBots", &HumanController::addBots ).addShortcut().defaultValues(1); -
code/trunk/src/orxonox/worldentities/pawns/Spectator.cc
r7862 r7863 43 43 { 44 44 extern const std::string __CC_fire_name; 45 extern const std::string __CC_suicide_name; 45 46 46 47 CreateFactory(Spectator); … … 154 155 155 156 /** 156 @brief Changes the keybind mode of the fire command to OnPress.157 @brief Changes the behavior of some console commands. 157 158 */ 158 159 void Spectator::startLocalHumanControl() … … 162 163 // change keybind mode of fire command to OnPress to avoid firing after respawn 163 164 ModifyConsoleCommand(__CC_fire_name).keybindMode(KeybindMode::OnPress); 165 166 // disable suicide 167 ModifyConsoleCommand(__CC_suicide_name).pushFunction(&prototype::void__void); 164 168 } 165 169 166 170 /** 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. 168 172 */ 169 173 void Spectator::stopLocalHumanControl() … … 174 178 // 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 175 179 ModifyConsoleCommand(__CC_fire_name).pushFunction(&Spectator::resetFireCommand).keybindMode(KeybindMode::OnPress); 180 181 // enable suicide 182 ModifyConsoleCommand(__CC_suicide_name).popFunction(); 176 183 } 177 184
Note: See TracChangeset
for help on using the changeset viewer.