From b7361c0e05e3eb40a6d866c431314a70f0f9d31f Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 11 Nov 2015 07:40:45 +0000 Subject: [PATCH] update placeholder portals if the faction/location have changed --- code/map_data_render.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/map_data_render.js b/code/map_data_render.js index 57abf462..d3811a15 100644 --- a/code/map_data_render.js +++ b/code/map_data_render.js @@ -267,6 +267,17 @@ window.Render.prototype.createPlaceholderPortalEntity = function(guid,latE6,lngE ] ]; + // placeholder portals don't have a useful timestamp value - so the standard code that checks for updated + // portal details doesn't apply + // so, check that the basic details are valid and delete the existing portal if out of date + if (guid in window.portals) { + var p = window.portals[guid]; + if (team != p.options.data.team || latE6 != p.options.data.latE6 || lngE6 != p.options.data.lngE6) { + // team or location have changed - delete existing portal + this.deletePortalEntity(guid); + } + } + this.createPortalEntity(ent); }