mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-18 01:21:32 +00:00
- fixed overflow issue with large damage values in P_RadiusAttack.
This commit is contained in:
parent
c3eec6db4d
commit
ba7260c176
1 changed files with 2 additions and 2 deletions
|
@ -5178,8 +5178,8 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo
|
||||||
}
|
}
|
||||||
points *= thing->GetClass()->RDFactor;
|
points *= thing->GetClass()->RDFactor;
|
||||||
|
|
||||||
// points and bombdamage should be the same sign
|
// points and bombdamage should be the same sign (the double cast of 'points' is needed to prevent overflows and incorrect values slipping through.)
|
||||||
if (((int(points) * bombdamage) > 0) && P_CheckSight(thing, bombspot, SF_IGNOREVISIBILITY | SF_IGNOREWATERBOUNDARY))
|
if ((((double)int(points) * bombdamage) > 0) && P_CheckSight(thing, bombspot, SF_IGNOREVISIBILITY | SF_IGNOREWATERBOUNDARY))
|
||||||
{ // OK to damage; target is in direct path
|
{ // OK to damage; target is in direct path
|
||||||
double vz;
|
double vz;
|
||||||
double thrust;
|
double thrust;
|
||||||
|
|
Loading…
Reference in a new issue