MCPcopy Create free account
hub / github.com/assaultcube/AC / loopv

Function loopv

source/src/bot/bot_ai.cpp:133–158  ·  view source on GitHub ↗

First loop through all bots

Source from the content-addressed store, hash-verified

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) &&

Callers 1

RespawnBotsMethod · 0.70

Calls 3

GetDistanceFunction · 0.85
IsVisibleFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected