Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 3, 2014, 9:28:38 PM (11 years ago)
Author:
landauf
Message:

fixed warnings (msvc)

File:
1 edited

Legend:

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

    r9945 r9962  
    207207    // functions for dynamic Way-search
    208208
    209     int SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint)
     209    float SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint)
    210210    {
    211211        if (this->getControllableEntity() != NULL)
     
    222222    RaceCheckPoint* SpaceRaceController::nextPointFind(RaceCheckPoint* raceCheckpoint)
    223223    {
    224         int distances[] = {-1, -1, -1};
     224        float distances[] = {-1, -1, -1};
    225225        int temp_i = 0;
    226226        for (std::set<int>::iterator it =raceCheckpoint->getVirtualNextCheckpoints().begin(); it!= raceCheckpoint->getVirtualNextCheckpoints().end(); ++it)
     
    229229            temp_i++;
    230230        }
    231         if (distances[0] > distances[1] && distances[1] != -1)
    232         {
    233             if (distances[2] < distances[1] && distances[2] != -1)
     231        if (distances[0] > distances[1] && distances[1] >= 0)
     232        {
     233            if (distances[2] < distances[1] && distances[2] >= 0)
    234234            {
    235235                return findCheckpoint(*raceCheckpoint->getVirtualNextCheckpoints().end()); // return checkpoint with ID of raceCheckpoint->getNextCheckpoints() [2]
     
    243243        else
    244244        {
    245             if (distances[2] < distances[0] && distances[2] != -1)
     245            if (distances[2] < distances[0] && distances[2] >= 0)
    246246            {
    247247                return findCheckpoint(*raceCheckpoint->getVirtualNextCheckpoints().end()); // return [2]
     
    258258     * returns the distance between "currentPosition" and the next static checkpoint that can be reached from "currentCheckPoint"
    259259     */
    260     int SpaceRaceController::recCalculateDistance(RaceCheckPoint* currentCheckPoint, Vector3 currentPosition)
     260    float SpaceRaceController::recCalculateDistance(RaceCheckPoint* currentCheckPoint, Vector3 currentPosition)
    261261    {
    262262        // find: looks if the currentCheckPoint is a staticCheckPoint (staticCheckPoint is the same as: static Point)
     
    267267        else
    268268        {
    269             int minimum = std::numeric_limits<int>::max();
     269            float minimum = std::numeric_limits<float>::max();
    270270            for (std::set<int>::iterator it = currentCheckPoint->getVirtualNextCheckpoints().begin(); it != currentCheckPoint->getVirtualNextCheckpoints().end(); ++it)
    271271            {
Note: See TracChangeset for help on using the changeset viewer.