From b0d5695b442faa8e1d2679101ec780f6bb9d263a Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Tue, 5 Feb 2013 14:24:49 +0100 Subject: [PATCH] fix portal level calc for low level portals --- code/portal_info.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/portal_info.js b/code/portal_info.js index 3a4aa908..c18ca85a 100644 --- a/code/portal_info.js +++ b/code/portal_info.js @@ -8,11 +8,13 @@ // that value. window.getPortalLevel = function(d) { var lvl = 0; + var hasReso = false; $.each(d.resonatorArray.resonators, function(ind, reso) { if(!reso) return true; lvl += parseInt(reso.level); + hasReso = true; }); - return lvl/8; + return hasReso ? Math.min(1, lvl/8) : 0; } window.getPortalEnergy = function(d) {