From 4b74b125e175fad2855791881083515c73663c02 Mon Sep 17 00:00:00 2001 From: Colin McLeod Date: Tue, 2 Jun 2015 20:07:08 -0700 Subject: [PATCH] Enhance ship jump range function --- app/js/shipyard/factory-ship.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/js/shipyard/factory-ship.js b/app/js/shipyard/factory-ship.js index a8ba3b67..eb6319bf 100755 --- a/app/js/shipyard/factory-ship.js +++ b/app/js/shipyard/factory-ship.js @@ -167,12 +167,14 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', }; /** - * [jumpRange description] - * @param {number} mass [description] + * Calculate jump range using the installed FSD and the + * specified mass which can be more or less than ships actual mass + * @param {number} mass Mass in tons + * @param {number} fuel Fuel available in tons * @return {number} Jump range in Light Years */ - Ship.prototype.jumpRangeWithMass = function (mass) { - return calcJumpRange(mass, this.common[2].c); + Ship.prototype.jumpRangeWithMass = function (mass, fuel) { + return calcJumpRange(mass, this.common[2].c, fuel); }; /**