From ac1fb62d61fa6a16a43667ac4f16c324f806a54e Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Fri, 3 Jun 2022 12:07:37 +0800 Subject: fix patcher waypoints sometimes not dissapearing --- features/waypoints/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'features') diff --git a/features/waypoints/index.js b/features/waypoints/index.js index 7c240ce..d5957e7 100644 --- a/features/waypoints/index.js +++ b/features/waypoints/index.js @@ -76,6 +76,8 @@ class Waypoints extends Feature { if (this.showInfoInChat.getValue()) ChatLib.chat(this.FeatureManager.messagePrefix + "Deleted waypoint " + name + "!") }) this.registerCommand("clearwaypoints", () => { + this.userWaypointsAll.forEach(w => w.stopRender()) + Object.values(this.userWaypointsHash).forEach(a => a.forEach(w => w.stopRender())) this.userWaypoints = {} this.userWaypointsArr = [] this.waypointsChanged = true @@ -104,14 +106,14 @@ class Waypoints extends Feature { this.registerChat("&r${*} &8> ${player}&f: &rx: ${x}, y: ${y}, z: ${z}", (player, x, y, z, e) => { if (this.loadWaypointsFromSendCoords.getValue()) { this.patcherWaypoints.push([Date.now(), new Waypoint(parseInt(x), parseInt(y), parseInt(ChatLib.removeFormatting(z)), 0, 0, 1, { name: ChatLib.addColor(player), showDist: true }).startRender()]) - if (this.patcherWaypoints.length > 10) this.patcherWaypoints.shift() + if (this.patcherWaypoints.length > 10) this.patcherWaypoints.shift()[1].stopRender() } }) this.registerChat("${player}&r&f: x: ${x}, y: ${y}, z: ${z}", (player, x, y, z, e) => { if (player.includes(">")) return if (this.loadWaypointsFromSendCoords.getValue()) {//parseInt(x), parseInt(y), parseInt(ChatLib.removeFormatting(z)), ChatLib.addColor(player) this.patcherWaypoints.push([Date.now(), new Waypoint(parseInt(x), parseInt(y), parseInt(ChatLib.removeFormatting(z)), 0, 0, 1, { name: ChatLib.addColor(player), showDist: true }).startRender()]) - if (this.patcherWaypoints.length > 10) this.patcherWaypoints.shift() + if (this.patcherWaypoints.length > 10) this.patcherWaypoints.shift()[1].stopRender() } }) -- cgit