263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
int best;
float bdist = 99999;
loopv(ents)
{
entity &e = ents[i];
if (e.type == NOTUSED)
continue;
vec v = {(float)e.x, (float)e.y, (float)e.z};
vdist(dist, t, player1->o, v);
if (dist < bdist) {
best = i;
bdist = dist;
};
};
return bdist == 99999 ? -1 : best;
|
|
|
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
int best;
float bdist = 99999;
loopv(ents)
{
entity &e = ents[i];
if (e.type == NOTUSED)
continue;
OFVector3D v = OFMakeVector3D(e.x, e.y, e.z);
vdist(dist, t, player1->o, v);
if (dist < bdist) {
best = i;
bdist = dist;
};
};
return bdist == 99999 ? -1 : best;
|