mirror of
https://github.com/nzp-team/dquakeplus.git
synced 2024-11-22 20:02:37 +00:00
Modify PF_findradius to not use sqrtf
also a safety pre-compute of radius^2 in case it doesnt get picked up by gcc. thanks spike.
This commit is contained in:
parent
625e0b8103
commit
8520c1923b
1 changed files with 4 additions and 1 deletions
|
@ -1100,7 +1100,9 @@ void PF_findradius (void)
|
|||
chain = (edict_t *)sv.edicts;
|
||||
|
||||
org = G_VECTOR(OFS_PARM0);
|
||||
|
||||
rad = G_FLOAT(OFS_PARM1);
|
||||
rad *= rad;
|
||||
|
||||
ent = NEXT_EDICT(sv.edicts);
|
||||
for (i=1 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(ent))
|
||||
|
@ -1111,7 +1113,8 @@ void PF_findradius (void)
|
|||
continue;
|
||||
for (j=0 ; j<3 ; j++)
|
||||
eorg[j] = org[j] - (ent->v.origin[j] + (ent->v.mins[j] + ent->v.maxs[j])*0.5);
|
||||
if (Length(eorg) > rad)
|
||||
|
||||
if (DotProduct(eorg, eorg) > rad)
|
||||
continue;
|
||||
|
||||
ent->v.chain = EDICT_TO_PROG(chain);
|
||||
|
|
Loading…
Reference in a new issue