From 766fc53303eb93468874245a620e675daf25d6a7 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Wed, 8 Jun 2022 18:31:41 +0800 Subject: + fix map heads being in wrong places --- features/dungeonMap/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'features') diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js index bc54aa5..8351a11 100644 --- a/features/dungeonMap/index.js +++ b/features/dungeonMap/index.js @@ -389,11 +389,13 @@ class DungeonMap extends Feature { let playerI = 0 for (let i = 0; i < 5; i++) { let name = ChatLib.removeFormatting(Player.getContainer().getStackInSlot(3 + i)?.getName()?.split(" ")?.pop() || "") - if (this.nameToUUID[name]) { + if (this.nameToUUID[name] && this.nameToUUID[name] !== Player.getUUID().toString()) { this.idToPlayer[playerI] = this.nameToUUID[name] } if (name) playerI++ } + this.idToPlayer[playerI] = Player.getUUID().toString() + playerI++ if (playerI !== World.getAllPlayers().filter(p => p.getPing() === 1).length) this.idToPlayer = {} } // console.log("asjbfoasbgp") @@ -692,7 +694,7 @@ class DungeonMap extends Feature { }) while (this.idToPlayer[i] && this.deadPlayers.has(this.idToPlayer[i])) i++ if (this.idToPlayer[i]) closestP = this.idToPlayer[i] - if (closestP) { + if (closestP && closestP !== Player.getUUID().toString()) { // console.log(closestP, x, y) this.mapDataPlayers[closestP].x = x this.mapDataPlayers[closestP].y = y -- cgit