Changeset 10919 for code/branches/cpp11_v2/src/modules/objects/controllers
- Timestamp:
- Dec 5, 2015, 10:47:51 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/objects/controllers/TurretController.cc
r10818 r10919 103 103 Pawn* minScorePawn = nullptr; 104 104 105 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 106 { 107 Pawn* entity = orxonox_cast<Pawn*>(*it); 108 if (!entity || FormationController::sameTeam(turret, entity, this->getGametype())) 105 for (Pawn* pawn : ObjectList<Pawn>()) 106 { 107 if (!pawn || FormationController::sameTeam(turret, pawn, this->getGametype())) 109 108 continue; 110 tempScore = turret->isInRange( entity);109 tempScore = turret->isInRange(pawn); 111 110 if(tempScore != -1.f) 112 111 { … … 114 113 { 115 114 minScore = tempScore; 116 minScorePawn = entity;115 minScorePawn = pawn; 117 116 } 118 117 }
Note: See TracChangeset
for help on using the changeset viewer.