fix portal range being larger zero even if resos are missing
This commit is contained in:
@ -29,6 +29,17 @@ window.getPortalEnergy = function(d) {
|
|||||||
window.getPortalRange = function(d) {
|
window.getPortalRange = function(d) {
|
||||||
// formula by the great gals and guys at
|
// formula by the great gals and guys at
|
||||||
// http://decodeingress.me/2012/11/18/ingress-portal-levels-and-link-range/
|
// http://decodeingress.me/2012/11/18/ingress-portal-levels-and-link-range/
|
||||||
|
|
||||||
|
var lvl = 0;
|
||||||
|
var resoMissing = false;
|
||||||
|
$.each(d.resonatorArray.resonators, function(ind, reso) {
|
||||||
|
if(!reso) {
|
||||||
|
resoMissing = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
lvl += parseInt(reso.level);
|
||||||
|
});
|
||||||
|
if(resoMissing) return 0;
|
||||||
return 160*Math.pow(getPortalLevel(d), 4);
|
return 160*Math.pow(getPortalLevel(d), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user