Changeset 10765 for code/branches/cpp11_v2/src/modules/gametypes
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/gametypes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc
r9973 r10765 125 125 } 126 126 } 127 return NULL;127 return nullptr; 128 128 } 129 129 -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
r10318 r10765 98 98 RaceCheckPoint* point2 = findCheckpoint((*numb)); 99 99 100 //if(point2 != NULL)100 //if(point2 != nullptr) 101 101 //placeVirtualCheckpoints((*it), point2); 102 102 } … … 126 126 staticRacePoints_ = findStaticCheckpoints(nextRaceCheckpoint_, checkpoints); 127 127 // initialisation of currentRaceCheckpoint_ 128 currentRaceCheckpoint_ = NULL;128 currentRaceCheckpoint_ = nullptr; 129 129 130 130 int i; 131 for (i = -2; findCheckpoint(i) != NULL; i--)131 for (i = -2; findCheckpoint(i) != nullptr; i--) 132 132 { 133 133 continue; … … 194 194 continue; 195 195 } 196 if (findCheckpoint(*it) == NULL)196 if (findCheckpoint(*it) == nullptr) 197 197 orxout(internal_warning) << "Problematic Point: " << (*it) << endl; 198 198 else … … 209 209 float SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint) 210 210 { 211 if (this->getControllableEntity() != NULL)211 if (this->getControllableEntity() != nullptr) 212 212 { 213 213 return (CheckPoint->getPosition()- this->getControllableEntity()->getPosition()).length(); … … 223 223 { 224 224 float minDistance = 0; 225 RaceCheckPoint* minNextRaceCheckPoint = NULL;225 RaceCheckPoint* minNextRaceCheckPoint = nullptr; 226 226 227 227 // find the next checkpoint with the minimal distance … … 231 231 float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition()); 232 232 233 if (distance < minDistance || minNextRaceCheckPoint == NULL)233 if (distance < minDistance || minNextRaceCheckPoint == nullptr) 234 234 { 235 235 minDistance = distance; … … 271 271 RaceCheckPoint* SpaceRaceController::adjustNextPoint() 272 272 { 273 if (currentRaceCheckpoint_ == NULL) // no Adjust possible273 if (currentRaceCheckpoint_ == nullptr) // no Adjust possible 274 274 275 275 { … … 292 292 if (this->checkpoints_[i]->getCheckpointIndex() == index) 293 293 return this->checkpoints_[i]; 294 return NULL;294 return nullptr; 295 295 } 296 296 … … 347 347 void SpaceRaceController::tick(float dt) 348 348 { 349 if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL)349 if (this->getControllableEntity() == nullptr || this->getControllableEntity()->getPlayer() == nullptr ) 350 350 { 351 351 //orxout()<< this->getControllableEntity() << " in tick"<<endl; … … 419 419 { 420 420 btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape(); 421 if(currentShape == NULL)421 if(currentShape == nullptr) 422 422 continue; 423 423 … … 447 447 { 448 448 btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape(); 449 if(currentShape == NULL)449 if(currentShape == nullptr) 450 450 continue; 451 451 … … 491 491 { 492 492 493 if (dynamic_cast<RaceCheckPoint*>(*it) != NULL)493 if (dynamic_cast<RaceCheckPoint*>(*it) != nullptr) 494 494 { 495 495 continue; … … 537 537 // btVector3 positionObject; 538 538 // btScalar radiusObject; 539 // if((*it)== NULL)539 // if((*it)==nullptr) 540 540 // { orxout()<<"Problempoint 1.1"<<endl; continue;} 541 541 // //TODO: Probably it points on a wrong object 542 542 // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++) 543 543 // { 544 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()== NULL)544 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr) 545 545 // { continue;} 546 546 // … … 570 570 // btVector3 positionObject; 571 571 // btScalar radiusObject; 572 // if((*it)== NULL)572 // if((*it)==nullptr) 573 573 // { orxout()<<"Problempoint 1"<<endl; continue;} 574 574 // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++) 575 575 // { 576 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()== NULL)576 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr) 577 577 // { orxout()<<"Problempoint 2.2"<<endl; continue;} 578 578 // (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject); -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc
r10624 r10765 71 71 this->players_ = this->race_->getPlayers(); 72 72 73 if (this->checkpoints_[0] != NULL&& !this->firstcheckpointvisible_)73 if (this->checkpoints_[0] != nullptr && !this->firstcheckpointvisible_) 74 74 { 75 75 this->checkpoints_[0]->setRadarVisibility(true); … … 121 121 bool SpaceRaceManager::reachedValidCheckpoint(RaceCheckPoint* oldCheckpoint, RaceCheckPoint* newCheckpoint, PlayerInfo* player) const 122 122 { 123 if (oldCheckpoint != NULL)123 if (oldCheckpoint != nullptr) 124 124 { 125 125 // the player already visited an old checkpoint; see which checkpoints are possible now
Note: See TracChangeset
for help on using the changeset viewer.