From 9852b680f57cf30d9b1fee9045e29d67db013271 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Tue, 17 Dec 2013 03:38:56 +0000 Subject: [PATCH] further to #704, use the existing function to both filter and sort link amps, so (in theory) combinations of rare+very rare are handled correctly --- code/portal_info.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/portal_info.js b/code/portal_info.js index eb1b6dff..cd2af05e 100644 --- a/code/portal_info.js +++ b/code/portal_info.js @@ -74,13 +74,14 @@ window.getLinkAmpRangeBoost = function(d) { var boost = 0.0; // initial boost is 0.0 (i.e. no boost over standard range) var count = 0; - $.each(d.portalV2.linkedModArray, function(ind, mod) { - if(mod && mod.type === 'LINK_AMPLIFIER' && mod.stats && mod.stats.LINK_RANGE_MULTIPLIER) { - // link amp stat LINK_RANGE_MULTIPLIER is 2000 for rare, and gives 2x boost to the range - var baseMultiplier = mod.stats.LINK_RANGE_MULTIPLIER/1000; - boost += baseMultiplier*scale[count]; - count++; - } + var linkAmps = getPortalModsByType(d, 'LINK_AMPLIFIER'); + + $.each(linkAmps, function(ind, mod) { + // link amp stat LINK_RANGE_MULTIPLIER is 2000 for rare, and gives 2x boost to the range + // and very-rare is 7000 and gives 7x the range + var baseMultiplier = mod.stats.LINK_RANGE_MULTIPLIER/1000; + boost += baseMultiplier*scale[count]; + count++; }); return (count > 0) ? boost : 1.0;