mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- fixed: The distance check in A_RadiusGive could overflow for large distances.
This commit is contained in:
parent
cf579e4c77
commit
16ad440adb
1 changed files with 3 additions and 4 deletions
|
@ -5068,9 +5068,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
|
||||||
|
|
||||||
if (flags & RGF_CUBE)
|
if (flags & RGF_CUBE)
|
||||||
{ // check if inside a cube
|
{ // check if inside a cube
|
||||||
if (abs(thing->x - self->x) > distance ||
|
if (fabs((double)thing->x - self->x) > (double)distance ||
|
||||||
abs(thing->y - self->y) > distance ||
|
fabs((double)thing->y - self->y) > (double)distance ||
|
||||||
abs((thing->z + thing->height/2) - (self->z + self->height/2)) > distance)
|
fabs((double)(thing->z + thing->height/2) - (self->z + self->height/2)) > (double)distance)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -5084,7 +5084,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fixed_t dz = abs ((thing->z + thing->height/2) - (self->z + self->height/2));
|
|
||||||
|
|
||||||
if ((flags & RGF_NOSIGHT) || P_CheckSight (thing, self, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY))
|
if ((flags & RGF_NOSIGHT) || P_CheckSight (thing, self, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY))
|
||||||
{ // OK to give; target is in direct path, or the monster doesn't care about it being in line of sight.
|
{ // OK to give; target is in direct path, or the monster doesn't care about it being in line of sight.
|
||||||
|
|
Loading…
Reference in a new issue