Changeset 10062 for code/branches/turretFS14/src/modules/objects
- Timestamp:
- May 20, 2014, 9:03:19 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/turretFS14/src/modules/objects/controllers/TurretController.cc
r10060 r10062 97 97 } 98 98 99 float m axScore = 0;99 float minScore = FLT_MAX; 100 100 float tempScore; 101 Pawn* m axScorePawn = 0;101 Pawn* minScorePawn = 0; 102 102 103 103 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) … … 109 109 if(tempScore != -1.f) 110 110 { 111 if(tempScore > maxScore)111 if(tempScore < minScore) 112 112 { 113 m axScore = tempScore;114 m axScorePawn = entity;113 minScore = tempScore; 114 minScorePawn = entity; 115 115 } 116 116 } 117 117 } 118 this->setTarget(m axScorePawn);119 turret->setTarget(m axScorePawn);118 this->setTarget(minScorePawn); 119 turret->setTarget(minScorePawn); 120 120 } 121 121 … … 138 138 Scores a pawn as a target, based on distance and health. 139 139 140 The more health and distance a pawn has, the higher the score. This means lower equals better target.140 The more health and distance a pawn has, the higher the score. This means lower equals better. 141 141 142 142 @param pawn
Note: See TracChangeset
for help on using the changeset viewer.