Skip to content

Commit

Permalink
Follow players through dimensions on web ui (fixes #145)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Dec 4, 2023
1 parent fa19667 commit ec04b81
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions common/src/main/resources/web/js/modules/PlayerList.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,16 @@ class PlayerList {
// follow highlighted player
if (this.following != null) {
const player = this.players.get(this.following);
if (player == null || P.worldList.curWorld == null || player.world !== P.worldList.curWorld.name) {
if (player == null || P.worldList.curWorld == null) {
this.followPlayerMarker(null);
} else {
P.map.panTo(P.toLatLng(player.x, player.z));
if (player.world !== P.worldList.curWorld.name) {
P.worldList.showWorld(player.world, () => {
P.map.panTo(P.toLatLng(player.x, player.z));
});
} else {
P.map.panTo(P.toLatLng(player.x, player.z));
}
}
}
}
Expand Down

0 comments on commit ec04b81

Please sign in to comment.