Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 6, 2015, 10:18:25 PM (10 years ago)
Author:
landauf
Message:

removed hack. addBots/killBots is now part of Gametype

Location:
code/branches/core7/src/orxonox
Files:
4 edited

Legend:

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

    r10347 r10349  
    5959    SetConsoleCommand("HumanController", __CC_suicide_name,        &HumanController::suicide       ).addShortcut();
    6060    SetConsoleCommand("HumanController", "toggleGodMode",          &HumanController::toggleGodMode ).addShortcut();
    61     SetConsoleCommand("HumanController", "addBots",                &HumanController::addBots       ).addShortcut().defaultValues(1);
    62     SetConsoleCommand("HumanController", "killBots",               &HumanController::killBots      ).addShortcut().defaultValues(0);
    6361    SetConsoleCommand("HumanController", "cycleNavigationFocus",   &HumanController::cycleNavigationFocus).addShortcut();
    6462    SetConsoleCommand("HumanController", "releaseNavigationFocus", &HumanController::releaseNavigationFocus).addShortcut();
     
    318316    }
    319317
    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 
    332318    Pawn* HumanController::getLocalControllerEntityAsPawn()
    333319    {
  • code/branches/core7/src/orxonox/controllers/HumanController.h

    r9979 r10349  
    8383            static void FFChangeMode();
    8484
    85             static void addBots(unsigned int amount);
    86             static void killBots(unsigned int amount = 0);
    87 
    8885            static void pauseControl(); // tolua_export
    8986            static void resumeControl(); // tolua_export
  • code/branches/core7/src/orxonox/gametypes/Gametype.cc

    r10348 r10349  
    4949namespace orxonox
    5050{
     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
    5157    RegisterUnloadableClass(Gametype);
    5258
     
    8490            this->scoreboard_ = 0;
    8591
    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);
    9094    }
    9195
     
    9599        {
    96100            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);
    101104        }
    102105    }
  • code/branches/core7/src/orxonox/gametypes/Gametype.h

    r10281 r10349  
    199199            std::string scoreboardTemplate_;
    200200
    201             /* HACK HACK HACK */
    202             ConsoleCommand* dedicatedAddBots_;
    203             ConsoleCommand* dedicatedKillBots_;
    204             /* HACK HACK HACK */
    205201            Timer showMenuTimer_;
    206202    };
Note: See TracChangeset for help on using the changeset viewer.