First loop through all bots
| 131 | |
| 132 | // First loop through all bots |
| 133 | loopv(bots) |
| 134 | { |
| 135 | d = bots[i]; // Handy shortcut |
| 136 | |
| 137 | if (d == m_pMyEnt || !d || isteam(d->team, m_pMyEnt->team) || (d->state != CS_ALIVE)) |
| 138 | continue; |
| 139 | |
| 140 | // Check if the enemy is visible |
| 141 | if(!DetectEnemy(d)) |
| 142 | continue; |
| 143 | |
| 144 | flDist = GetDistance(d->o); |
| 145 | EnemyVal = 1; |
| 146 | |
| 147 | if (flDist < flNearestDist) |
| 148 | { |
| 149 | EnemyVal+=2; |
| 150 | flNearestDist = flDist; |
| 151 | } |
| 152 | |
| 153 | if (EnemyVal > BestEnemyVal) |
| 154 | { |
| 155 | pNewEnemy = d; |
| 156 | BestEnemyVal = EnemyVal; |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | // Then examine the local player |
| 161 | if (player1 && !isteam(player1->team, m_pMyEnt->team) && |
no test coverage detected