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.
This commit is contained in:
Stefan Breunig 2013-02-13 20:20:29 +01:00
parent 3bbca39353
commit 841223f837

View File

@ -225,9 +225,14 @@ window.renderPortal = function(ent) {
var oo = old.options; var oo = old.options;
var u = oo.team !== team; var u = oo.team !== team;
u = u || oo.level !== portalLevel; u = u || oo.level !== portalLevel;
// nothing for the portal changed, so dont update. Let resonators // nothing changed that requires re-rendering the portal.
// manage themselves if they want to be updated. if(!u) {
if(!u) return renderResonators(ent, old); // 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 // there were changes, remove old portal
removeByGuid(ent[0]); removeByGuid(ent[0]);
} }