diff --git a/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js b/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js index f140074f..073c9139 100644 --- a/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js +++ b/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js @@ -50,6 +50,7 @@ export default class PlayerMarkerSet { updateWith(liveData){ this.marker.forEach(marker => { marker.nowOnline = false; + marker.worldChanged = false; }); for(let i = 0; i < liveData.players.length; i++){ @@ -72,12 +73,15 @@ export default class PlayerMarkerSet { marker.nowOnline = true; marker.position = new Vector3(player.position.x, player.position.y + 1.5, player.position.z); - marker.world = player.world; + if (marker.world !== player.world) { + marker.world = player.world; + marker.worldChanged = true; + } marker.updatePosition(); } this.marker.forEach(marker => { - if (marker.nowOnline !== marker.online){ + if (marker.nowOnline !== marker.online || marker.worldChanged){ marker.online = marker.nowOnline; marker.setVisible(this.visible); }