From c24da31b9de67423dfe1f27ecdda2261385937cc Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 25 Sep 2013 11:27:03 +0100 Subject: [PATCH] fix defense plugin rendering details for portals not added to the map (and therefore not getting removed) --- plugins/portal-defense.user.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/portal-defense.user.js b/plugins/portal-defense.user.js index a04dc433..000a2cf5 100644 --- a/plugins/portal-defense.user.js +++ b/plugins/portal-defense.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-defense@gluckies // @name IITC plugin: portal defense // @category Layer -// @version 0.2.1.@@DATETIMEVERSION@@ +// @version 0.2.2.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -81,8 +81,11 @@ window.plugin.portalDefense.renderAttackRegion = function(portal) { } window.plugin.portalDefense.reload = function() { - $.each(window.portals, function(ind, portal){ - window.plugin.portalDefense.renderAttackRegion(portal) + $.each(window.portals, function(ind, portal) { + // only render mitigation details for portals added to the map + if (portal._map) { + window.plugin.portalDefense.renderAttackRegion(portal) + } }); }