- Timestamp:
- Apr 6, 2015, 10:18:25 PM (10 years ago)
- Location:
- code/branches/core7/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/orxonox/controllers/HumanController.cc
r10347 r10349 59 59 SetConsoleCommand("HumanController", __CC_suicide_name, &HumanController::suicide ).addShortcut(); 60 60 SetConsoleCommand("HumanController", "toggleGodMode", &HumanController::toggleGodMode ).addShortcut(); 61 SetConsoleCommand("HumanController", "addBots", &HumanController::addBots ).addShortcut().defaultValues(1);62 SetConsoleCommand("HumanController", "killBots", &HumanController::killBots ).addShortcut().defaultValues(0);63 61 SetConsoleCommand("HumanController", "cycleNavigationFocus", &HumanController::cycleNavigationFocus).addShortcut(); 64 62 SetConsoleCommand("HumanController", "releaseNavigationFocus", &HumanController::releaseNavigationFocus).addShortcut(); … … 318 316 } 319 317 320 void HumanController::addBots(unsigned int amount)321 {322 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())323 HumanController::localController_s->controllableEntity_->getGametype()->addBots(amount);324 }325 326 void HumanController::killBots(unsigned int amount)327 {328 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())329 HumanController::localController_s->controllableEntity_->getGametype()->killBots(amount);330 }331 332 318 Pawn* HumanController::getLocalControllerEntityAsPawn() 333 319 { -
code/branches/core7/src/orxonox/controllers/HumanController.h
r9979 r10349 83 83 static void FFChangeMode(); 84 84 85 static void addBots(unsigned int amount);86 static void killBots(unsigned int amount = 0);87 88 85 static void pauseControl(); // tolua_export 89 86 static void resumeControl(); // tolua_export -
code/branches/core7/src/orxonox/gametypes/Gametype.cc
r10348 r10349 49 49 namespace orxonox 50 50 { 51 static const std::string __CC_addBots_name = "addBots"; 52 static const std::string __CC_killBots_name = "killBots"; 53 54 SetConsoleCommand("Gametype", __CC_addBots_name, &Gametype::addBots ).addShortcut().defaultValues(1); 55 SetConsoleCommand("Gametype", __CC_killBots_name, &Gametype::killBots).addShortcut().defaultValues(0); 56 51 57 RegisterUnloadableClass(Gametype); 52 58 … … 84 90 this->scoreboard_ = 0; 85 91 86 /* HACK HACK HACK */ 87 this->dedicatedAddBots_ = new ConsoleCommand( "dedicatedAddBots", createExecutor( createFunctor(&Gametype::addBots, this) ) ); 88 this->dedicatedKillBots_ = new ConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) ); 89 /* HACK HACK HACK */ 92 ModifyConsoleCommand(__CC_addBots_name).setObject(this); 93 ModifyConsoleCommand(__CC_killBots_name).setObject(this); 90 94 } 91 95 … … 95 99 { 96 100 this->gtinfo_->destroy(); 97 if( this->dedicatedAddBots_ ) 98 delete this->dedicatedAddBots_; 99 if( this->dedicatedKillBots_ ) 100 delete this->dedicatedKillBots_; 101 102 ModifyConsoleCommand(__CC_addBots_name).setObject(NULL); 103 ModifyConsoleCommand(__CC_killBots_name).setObject(NULL); 101 104 } 102 105 } -
code/branches/core7/src/orxonox/gametypes/Gametype.h
r10281 r10349 199 199 std::string scoreboardTemplate_; 200 200 201 /* HACK HACK HACK */202 ConsoleCommand* dedicatedAddBots_;203 ConsoleCommand* dedicatedKillBots_;204 /* HACK HACK HACK */205 201 Timer showMenuTimer_; 206 202 };
Note: See TracChangeset
for help on using the changeset viewer.