Skip to content

Commit bb7592c

Browse files
committed
Fix player-markers not updating the world correctly, the second
1 parent 2b2cf2d commit bb7592c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export default class PlayerMarkerSet {
5050
updateWith(liveData){
5151
this.marker.forEach(marker => {
5252
marker.nowOnline = false;
53+
marker.worldChanged = false;
5354
});
5455

5556
for(let i = 0; i < liveData.players.length; i++){
@@ -72,12 +73,15 @@ export default class PlayerMarkerSet {
7273

7374
marker.nowOnline = true;
7475
marker.position = new Vector3(player.position.x, player.position.y + 1.5, player.position.z);
75-
marker.world = player.world;
76+
if (marker.world !== player.world) {
77+
marker.world = player.world;
78+
marker.worldChanged = true;
79+
}
7680
marker.updatePosition();
7781
}
7882

7983
this.marker.forEach(marker => {
80-
if (marker.nowOnline !== marker.online){
84+
if (marker.nowOnline !== marker.online || marker.worldChanged){
8185
marker.online = marker.nowOnline;
8286
marker.setVisible(this.visible);
8387
}

0 commit comments

Comments
 (0)