Skip to content

Commit

Permalink
Merge pull request #642 from xscreach/fix/jumping-portals
Browse files Browse the repository at this point in the history
  • Loading branch information
modos189 authored Jul 9, 2023
2 parents d0bf66b + a04cad3 commit c185b94
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/code/map_data_render.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,19 @@ 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
var portalMoved = false;
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
portalMoved = latE6 !== p.options.data.latE6 || lngE6 !== p.options.data.lngE6;
if (team !== p.options.data.team) {
// team - delete existing portal
this.deletePortalEntity(guid);
}
}

this.createPortalEntity(ent, 'core'); // placeholder
if (!portalMoved) {
this.createPortalEntity(ent, 'core'); // placeholder
}

}

Expand Down

0 comments on commit c185b94

Please sign in to comment.