Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2018, 3:03:31 PM (6 years ago)
Author:
arismu
Message:

messages

File:
1 edited

Legend:

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

    r11982 r11986  
    107107        return returnVec;
    108108    }
    109     /*void SpaceRaceController::endtheGame() const {
     109    void SpaceRaceController::endtheGame() const {
    110110        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype());
    111         assert(gametype);
    112         if (!gametype)
     111        assert(gametype)
     112;        if (!gametype)
    113113        return;
     114        gametype->bLost=true;
    114115        gametype->end();
    115116
    116     }*/
     117    }
    117118    /*
    118119     * called from 'findStaticCheckpoints'
     
    176177        {
    177178            RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(checkpointIndex);
     179
    178180            float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition());
    179181
     
    184186
    185187            }
    186 
    187         }
    188         if(minNextRaceCheckPoint == nullptr) { orxout()<<"nullptr found @181 SpaceRaceController" << endl;}
     188            //There is a bug. If the user passes through the 19th checkpoint with the opponents, the game will end immediately
     189            if(nextRaceCheckPoint->isLast())
     190                endtheGame();
     191
     192        }
     193        if(minNextRaceCheckPoint == nullptr) { orxout()<<"nullptr found @192 SpaceRaceController" << endl;}
    189194        return minNextRaceCheckPoint;
    190195    }
Note: See TracChangeset for help on using the changeset viewer.