mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
simplify calcPipSpeed
also fix the order of parameters
This commit is contained in:
@@ -88,12 +88,12 @@ export function speed(mass, baseSpeed, thrusters, engpip) {
|
||||
|
||||
/**
|
||||
* Calculate pip multiplier for speed.
|
||||
* @param {number} topSpeed The top speed of ship in data
|
||||
* @param {number} baseSpeed The base speed of ship in data
|
||||
* @param {number} topSpeed The top speed of ship in data
|
||||
* @return {number} The multiplier that pips affect speed.
|
||||
*/
|
||||
export function calcPipSpeed(topSpeed, baseSpeed) {
|
||||
return 1 - ((topSpeed - ((topSpeed - baseSpeed) / 4)) / topSpeed);
|
||||
export function calcPipSpeed(baseSpeed, topSpeed) {
|
||||
return (topSpeed - baseSpeed) / (4 * topSpeed);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user