From 841223f8372ec60f24c223ccd9be4186a8c8ba91 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Wed, 13 Feb 2013 20:20:29 +0100 Subject: [PATCH] the patches to avoid re-rendering would not update the portal details if there were only minor changes (resos destroyed or energy level changed). This likely lead to the sidebar showing outdates information. The patch should solve #154, but please check carefully. --- code/map_data.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/code/map_data.js b/code/map_data.js index adc5f3c6..072c8259 100644 --- a/code/map_data.js +++ b/code/map_data.js @@ -225,9 +225,14 @@ window.renderPortal = function(ent) { var oo = old.options; var u = oo.team !== team; u = u || oo.level !== portalLevel; - // nothing for the portal changed, so don’t update. Let resonators - // manage themselves if they want to be updated. - if(!u) return renderResonators(ent, old); + // nothing changed that requires re-rendering the portal. + if(!u) { + // let resos handle themselves if they need to be redrawn + renderResonators(ent, old); + // update stored details for portal details in sidebar. + old.options.details = ent[2]; + return; + } // there were changes, remove old portal removeByGuid(ent[0]); }