Changeset 11071 for code/trunk/src/modules/objects/controllers
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/objects/controllers/TeamTargetProxy.cc
r10262 r11071 28 28 29 29 #include "TeamTargetProxy.h" 30 #include "core/CoreIncludes.h" 30 31 #include "worldentities/ControllableEntity.h" 31 32 #include "worldentities/pawns/Pawn.h" -
code/trunk/src/modules/objects/controllers/TurretController.cc
r10622 r11071 30 30 #include "worldentities/pawns/Pawn.h" 31 31 #include "objects/Turret.h" 32 #include "core/object/ObjectList.h" 33 #include "core/CoreIncludes.h" 32 34 33 35 namespace orxonox … … 81 83 { 82 84 this->forgetTarget(); 83 turret->setTarget( 0);85 turret->setTarget(nullptr); 84 86 } 85 87 … … 99 101 float minScore = FLT_MAX; 100 102 float tempScore; 101 Pawn* minScorePawn = 0; 102 103 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 104 { 105 Pawn* entity = orxonox_cast<Pawn*>(*it); 106 if (!entity || FormationController::sameTeam(turret, entity, this->getGametype())) 103 Pawn* minScorePawn = nullptr; 104 105 for (Pawn* pawn : ObjectList<Pawn>()) 106 { 107 if (!pawn || FormationController::sameTeam(turret, pawn, this->getGametype())) 107 108 continue; 108 tempScore = turret->isInRange( entity);109 tempScore = turret->isInRange(pawn); 109 110 if(tempScore != -1.f) 110 111 { … … 112 113 { 113 114 minScore = tempScore; 114 minScorePawn = entity;115 minScorePawn = pawn; 115 116 } 116 117 }
Note: See TracChangeset
for help on using the changeset viewer.