Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 5, 2012, 4:21:40 PM (12 years ago)
Author:
purgham
Message:

working Version 5.11.2012 - Bots can be included after starting the level

Location:
code/branches/Racingbot/src/modules/gametypes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.cc

    r9432 r9436  
    2929#include "gametypes/SpaceRaceManager.h"
    3030
    31 // Von SpaceRaceManager points einlesen
    32 // Berechnungsklasse nextPoint zur verfuegung stellen
    33 // ^- aufrufen ueber tick (if ob noetig)
     31// WEnn RAcer nach start erstellt wird fehler in Tick
     32// Fuer beide Spieler wird next point angezeigt
    3433namespace orxonox
    3534{
     
    4342    {
    4443        RegisterObject(SpaceRaceController);
    45 
    4644        std::vector<RaceCheckPoint*> checkpoints;
    4745        for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it!= ObjectList<SpaceRaceManager>::end(); ++it)
     
    6866    RaceCheckPoint* SpaceRaceController::nextPointFind(RaceCheckPoint* raceCheckpoint)
    6967    {
    70         int distances[] = { -1, -1, -1 };
     68        int distances[] =
     69        {   -1, -1, -1};
    7170        int temp_i = 0;
    7271        for (std::set<int>::iterator it =raceCheckpoint->getNextCheckpoints().begin(); it!= raceCheckpoint->getNextCheckpoints().end(); ++it)
     
    103102    {
    104103        if (currentRaceCheckpoint_ == NULL) // no Adjust possible
     104
    105105        {
    106106            return nextRaceCheckpoint_;
    107107        }
    108108        if ((currentRaceCheckpoint_->getNextCheckpoints()).size() == 1) // no Adjust possible
     109
    109110        {
    110111            return nextRaceCheckpoint_;
     
    141142    {
    142143        std::map<RaceCheckPoint*, int> * zaehler = new std::map<
    143                 RaceCheckPoint*, int>(); // counts how many times the checkpoit was reached (for simulation)
     144        RaceCheckPoint*, int>(); // counts how many times the checkpoit was reached (for simulation)
    144145        for (unsigned int i = 0; i < allCheckpoints.size(); i++)
    145146        {
     
    203204    void SpaceRaceController::tick(float dt)
    204205    {
     206        if (this->getControllableEntity() ==  NULL || this->getControllableEntity()->getPlayer() == NULL ){orxout()<<this->getControllableEntity()<<endl; return;}
    205207        if (nextRaceCheckpoint_->playerWasHere(this->getControllableEntity()->getPlayer()))
    206208        {//Checkpoint erreicht
  • code/branches/Racingbot/src/modules/gametypes/SpaceRaceManager.cc

    r9432 r9436  
    145145
    146146        RaceCheckPoint* oldCheckpoint = gametype->getCheckpointReached(player); // returns the last from player reached checkpoint
    147         // % fixing
    148         orxout() << "SpaceRaceManager.checkpointReached( "<<newCheckpoint->getCheckpointIndex()
    149                  <<", "<< player->isHumanPlayer() << endl;
    150         // % end fixing
     147
    151148        if (this->reachedValidCheckpoint(oldCheckpoint, newCheckpoint, player))
    152149        {
Note: See TracChangeset for help on using the changeset viewer.