mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 15:15:34 +00:00
fix: total range calculation bug
This commit is contained in:
@@ -191,7 +191,7 @@ angular.module('shipyard', ['ngLodash'])
|
|||||||
// Going backwards, start with the last jump using the remaining fuel
|
// Going backwards, start with the last jump using the remaining fuel
|
||||||
var totalRange = fuelRemaining > 0 ? Math.pow(fuelRemaining / fsd.fuelmul, 1 / fsd.fuelpower ) * fsd.optmass / mass : 0;
|
var totalRange = fuelRemaining > 0 ? Math.pow(fuelRemaining / fsd.fuelmul, 1 / fsd.fuelpower ) * fsd.optmass / mass : 0;
|
||||||
// For each max fuel jump, calculate the max jump range based on fuel left in the tank
|
// For each max fuel jump, calculate the max jump range based on fuel left in the tank
|
||||||
for (var j = Math.floor(jumps); j >= 0; j--) {
|
for (var j = 0, l = Math.floor(jumps); j < l; j++) {
|
||||||
fuelRemaining += fsd.maxfuel;
|
fuelRemaining += fsd.maxfuel;
|
||||||
totalRange += Math.pow(fsd.maxfuel / fsd.fuelmul, 1 / fsd.fuelpower ) * fsd.optmass / mass;
|
totalRange += Math.pow(fsd.maxfuel / fsd.fuelmul, 1 / fsd.fuelpower ) * fsd.optmass / mass;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user