Remove unnecessary parentheses
This commit is contained in:
@@ -217,7 +217,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
var at = (float)ticks / (length - 1);
|
||||
var attitude = angle.Tan() * (1 - 2 * at) / (4 * 1024);
|
||||
|
||||
var u = (facing.Angle % 512) / 512f;
|
||||
var u = facing.Angle % 512 / 512f;
|
||||
var scale = 2048 * u * (1 - u);
|
||||
|
||||
var effective = (int)(facing.Angle < 512
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
// angular speed in radians per tick = rot in facing units per tick * (pi radians / 128 facing units)
|
||||
// pi = 314 / 100
|
||||
// ==> loopRadius = (speed * 128 * 100) / (314 * rot)
|
||||
return (speed * 6400) / (157 * rot);
|
||||
return speed * 6400 / (157 * rot);
|
||||
}
|
||||
|
||||
void DetermineLaunchSpeedAndAngleForIncline(int predClfDist, int diffClfMslHgt, int relTarHorDist,
|
||||
@@ -315,9 +315,9 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
|
||||
// Compute minimum speed necessary to both be able to face directly upwards and have enough space
|
||||
// to hit the target without passing it by (and thus having to do horizontal loops)
|
||||
var minSpeed = ((System.Math.Min(predClfDist * 1024 / (1024 - WAngle.FromFacing(vFacing).Sin()),
|
||||
var minSpeed = (System.Math.Min(predClfDist * 1024 / (1024 - WAngle.FromFacing(vFacing).Sin()),
|
||||
(relTarHorDist + predClfDist) * 1024 / (2 * (2048 - WAngle.FromFacing(vFacing).Sin())))
|
||||
* info.VerticalRateOfTurn.Facing * 157) / 6400).Clamp(minLaunchSpeed, maxLaunchSpeed);
|
||||
* info.VerticalRateOfTurn.Facing * 157 / 6400).Clamp(minLaunchSpeed, maxLaunchSpeed);
|
||||
|
||||
if ((sbyte)vFacing < 0)
|
||||
speed = minSpeed;
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
|
||||
// Forward step, pointing from src to target.
|
||||
// QuantizationCont * forwardStep == One cycle of beam in src2target direction.
|
||||
ForwardStep = (info.HelixPitch.Length * SourceToTarget) / (info.QuantizationCount * SourceToTarget.Length);
|
||||
ForwardStep = info.HelixPitch.Length * SourceToTarget / (info.QuantizationCount * SourceToTarget.Length);
|
||||
|
||||
// An easy vector to find which is perpendicular vector to forwardStep, with 0 Z component
|
||||
LeftVector = new WVec(ForwardStep.Y, -ForwardStep.X, 0);
|
||||
|
||||
Reference in New Issue
Block a user