Bug fix in portal render limit handler and add function to clean up left over portals which should be removed after minimum display portal level rise.

This commit is contained in:
Xelio
2013-05-14 00:26:26 +08:00
parent ee589721e6
commit 3980a19e46
2 changed files with 51 additions and 36 deletions

View File

@ -160,6 +160,8 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
// Process the portals with portal render limit handler first
// Low level portal will hold until last request
var newPpp = portalRenderLimit.splitOrMergeLowLevelPortals(ppp);
// Clean up level of portal which over render limit after portalRenderLimit handler counted the new portals
portalRenderLimit.cleanUpOverLimitPortalLevel();
handlePortalsRender(newPpp);
resolvePlayerNames();
@ -174,15 +176,15 @@ window.handlePortalsRender = function(portals) {
// the portal
var oldSelectedPortal = selectedPortal;
runHooks('portalDataLoaded', {portals : portals});
$.each(portals, function(ind, portal) {
$.each(portals, function(guid, portal) {
//~ if(selectedPortal === portal[0]) portalUpdateAvailable = true;
if(urlPortalLL && urlPortalLL[0] === portal[2].locationE6.latE6/1E6 && urlPortalLL[1] === portal[2].locationE6.lngE6/1E6) {
urlPortal = portal[0];
urlPortal = guid;
portalInUrlAvailable = true;
urlPortalLL = null;
}
if(window.portals[portal[0]]) {
highlightPortal(window.portals[portal[0]]);
if(window.portals[guid]) {
highlightPortal(window.portals[guid]);
}
renderPortal(portal);
});