From 361c66562658c88bbbf8c392c9e06457be876b39 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 1 Jun 2014 19:04:52 +0100 Subject: [PATCH] link range - correctly flag missing resonators --- code/portal_info.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/portal_info.js b/code/portal_info.js index 96c25915..ad87794b 100644 --- a/code/portal_info.js +++ b/code/portal_info.js @@ -44,12 +44,16 @@ window.getPortalRange = function(d) { var lvl = 0; var resoMissing = false; + // currently we get a short resonator array when some are missing + if (d.resonators.length < 8) { + resoMissing = true; + } + // but in the past we used to always get an array of 8, but will 'null' objects for some entries. maybe that will return? $.each(d.resonators, function(ind, reso) { if(!reso) { resoMissing = true; return; } - lvl += parseInt(reso.level); }); var range = {