aboutsummaryrefslogtreecommitdiff
path: root/features/dungeonMap
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-08 18:31:41 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-08 18:31:41 +0800
commit766fc53303eb93468874245a620e675daf25d6a7 (patch)
tree6cebefc64db8f2c3fce3d4c05ef64ba68f2ab809 /features/dungeonMap
parent1cb7463dd27053f144b8fc8b7e8003a2f549e284 (diff)
downloadSoopyV2-766fc53303eb93468874245a620e675daf25d6a7.tar.gz
SoopyV2-766fc53303eb93468874245a620e675daf25d6a7.tar.bz2
SoopyV2-766fc53303eb93468874245a620e675daf25d6a7.zip
+ fix map heads being in wrong places
Diffstat (limited to 'features/dungeonMap')
-rw-r--r--features/dungeonMap/index.js6
1 files changed, 4 insertions, 2 deletions
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