forked from mirrors/0ad
Fix eslint rule 'operator-assignment'
eslint --no-config-lookup --fix --rule '"operator-assignment": 1' Ref: #7812 Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@ Math.cos = function(a)
|
||||
|
||||
// make b = 0 if a < pi/2 and b=1 if a > pi/2
|
||||
var b = (a-Math.PI/2) + Math.abs(a-Math.PI/2);
|
||||
b = b/(b+1e-30); // normalize b to one while avoiding divide by zero errors.
|
||||
b /=(b+1e-30); // normalize b to one while avoiding divide by zero errors.
|
||||
|
||||
// if a > pi/2 send a to pi-a, otherwise just send a to -a which has no effect
|
||||
// Using the symmetry cos(x) = -cos(pi-x) to bring a to the 0 to pi/2 range.
|
||||
@@ -197,7 +197,7 @@ Math.exp = function(x)
|
||||
return iPart;
|
||||
|
||||
// the integer part is known, work further with the decimal part of x
|
||||
x = x - Math.floor(x); // x \in [0,1)
|
||||
x -= Math.floor(x); // x \in [0,1)
|
||||
|
||||
// taylor series around 0
|
||||
// max error ~=~ 10^(-16)
|
||||
|
||||
@@ -759,7 +759,7 @@ function placeLine(teamsArray, distance, groupedDistance, startAngle)
|
||||
const mapCenter = g_Map.getCenter();
|
||||
const numAcross = 2 * getNumPlayers() / teamsArray.length; // if its two teams, numAcross is the same as numPlayers.
|
||||
const dist = fractionToTiles(numAcross == 2 ? 0.45 : 0.66 + (-0.01 * numAcross));
|
||||
groupedDistance = groupedDistance * (3.00 + (-0.225 * numAcross));
|
||||
groupedDistance *= (3.00 + (-0.225 * numAcross));
|
||||
for (let i = 0; i < teamsArray.length; ++i)
|
||||
{
|
||||
let safeDist = distance;
|
||||
|
||||
@@ -210,7 +210,7 @@ UnitMotionFlying.prototype.OnUpdate = function(msg)
|
||||
else if (pos.y > targetHeight)
|
||||
{
|
||||
pos.y = Math.max(targetHeight, pos.y - turnLength * this.template.ClimbRate);
|
||||
this.pitch = -1 * this.pitch;
|
||||
this.pitch *= -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user