add new long WRange.RangeSquared to avoid integer overflows

This commit is contained in:
Matthias Mailänder
2015-05-31 23:51:30 +02:00
parent 79edf648a7
commit ea5003cd2d
15 changed files with 18 additions and 22 deletions

View File

@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Warheads
continue;
// If the impact position is within any actor's health radius, we have a direct hit
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Radius.Range * healthInfo.Radius.Range)
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Radius.RangeSquared)
return true;
}