diff --git a/binaries/data/mods/public/globalscripts/Math.js b/binaries/data/mods/public/globalscripts/Math.js index d3ae43f66a..3418d13d86 100644 --- a/binaries/data/mods/public/globalscripts/Math.js +++ b/binaries/data/mods/public/globalscripts/Math.js @@ -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) diff --git a/binaries/data/mods/public/maps/random/rmgen-common/player.js b/binaries/data/mods/public/maps/random/rmgen-common/player.js index df63dda09a..b93b41faf0 100644 --- a/binaries/data/mods/public/maps/random/rmgen-common/player.js +++ b/binaries/data/mods/public/maps/random/rmgen-common/player.js @@ -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; diff --git a/binaries/data/mods/public/simulation/components/UnitMotionFlying.js b/binaries/data/mods/public/simulation/components/UnitMotionFlying.js index 817ae4bc79..f44ec91176 100644 --- a/binaries/data/mods/public/simulation/components/UnitMotionFlying.js +++ b/binaries/data/mods/public/simulation/components/UnitMotionFlying.js @@ -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; } } }