Changeset 9973 for code/trunk/src/modules/gametypes/RaceCheckPoint.cc
- Timestamp:
- Jan 4, 2014, 2:56:03 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/gametypes/RaceCheckPoint.cc
r9967 r9973 105 105 this->nextCheckpoints_.clear(); 106 106 107 if (checkpoints.x > - 1)108 this->nextCheckpoints_.insert(static_cast<int>(checkpoints.x + 0.5)); // the red number has the type double and for the cast (to int) is added 0.5 so that the cast works correctly109 if (checkpoints.y > - 1)110 this->nextCheckpoints_.insert(static_cast<int>(checkpoints.y + 0.5));111 if (checkpoints.z > - 1)112 this->nextCheckpoints_.insert(static_cast<int>(checkpoints.z + 0.5));107 if (checkpoints.x > -0.5) 108 this->nextCheckpoints_.insert(static_cast<int>(checkpoints.x + 0.5)); // the red number has the type double and for the cast (to int) is added 0.5 so that the cast works correctly 109 if (checkpoints.y > -0.5) 110 this->nextCheckpoints_.insert(static_cast<int>(checkpoints.y + 0.5)); 111 if (checkpoints.z > -0.5) 112 this->nextCheckpoints_.insert(static_cast<int>(checkpoints.z + 0.5)); 113 113 } 114 114 … … 146 146 { 147 147 Vector3 checkpoints(-1,-1,-1); int count=0; 148 for (std::set<int>::iterator it= nextCheckpoints_.begin();it!=nextCheckpoints_.end(); it++ ){ 148 for (std::set<int>::iterator it= nextCheckpoints_.begin();it!=nextCheckpoints_.end(); it++ ) 149 { 149 150 switch (count) 150 151 152 153 154 155 151 { 152 case 0: checkpoints.x = static_cast<Ogre::Real>(*it); break; 153 case 1: checkpoints.y = static_cast<Ogre::Real>(*it); break; 154 case 2: checkpoints.z = static_cast<Ogre::Real>(*it); break; 155 } 156 ++count; 156 157 } 157 158 return checkpoints;
Note: See TracChangeset
for help on using the changeset viewer.