Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 31, 2011, 11:36:18 PM (13 years ago)
Author:
jo
Message:

Console command still doesn't seem to work. botLevel_ is now defined between 0.0f and 1.0f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai/src/orxonox/controllers/ArtificialController.cc

    r7841 r7842  
    5252    SetConsoleCommand("ArtificialController", "passivebehaviour", &ArtificialController::passivebehaviour);
    5353    SetConsoleCommand("ArtificialController", "formationsize",    &ArtificialController::formationsize);
    54     SetConsoleCommand("ArtificialController", "botlevel",         &ArtificialController::setBotLevel);
     54    SetConsoleCommand("ArtificialController", "setbotlevel",      &ArtificialController::setAllBotLevel);
    5555   
    5656
     
    8888        this->bSetupWorked = false;
    8989        this->numberOfWeapons = 0;
    90         this->botlevel_ = 10.0f;
     90        this->botlevel_ = 1.0f;
    9191    }
    9292
     
    10691069    void ArtificialController::setBotLevel(float level)
    10701070    {
    1071         if (level < 1)
    1072             this->botlevel_ = 1 ;
    1073         else if (level > 10)
    1074             this->botlevel_ = 10;
     1071        if (level < 0.0f)
     1072            this->botlevel_ = 0.0f;
     1073        else if (level > 1.0f)
     1074            this->botlevel_ = 1.0f;
    10751075        else
    10761076            this->botlevel_ = level;
    10771077    }
     1078   
     1079    void ArtificialController::setAllBotLevel(float level)
     1080    {
     1081        for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it)
     1082            it->setBotLevel(level);
     1083    }
     1084   
    10781085}
Note: See TracChangeset for help on using the changeset viewer.