Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

removed hack. addBots/killBots is now part of Gametype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.