From 420779f515ca2df3cde7b8f6f383f9ead8e127a6 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sun, 18 Sep 2022 21:29:52 +0800 Subject: + swap promises to use arrow function for correct 'this' context --- src/features/waypoints/index.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/features/waypoints/index.js b/src/features/waypoints/index.js index 9188ddf..15843b5 100644 --- a/src/features/waypoints/index.js +++ b/src/features/waypoints/index.js @@ -153,6 +153,11 @@ class Waypoints extends Feature { console.log(e.stack) } }) + this.registerCommand("clearorderedwaypoints", () => { + this.currentOrderedWaypointIndex = -1 + this.orderedWaypoints.clear() + if (this.showInfoInChat.getValue()) ChatLib.chat(this.FeatureManager.messagePrefix + "Cleared waypoints!") + }) this.registerCommand("setorderwaypointindex", (ind) => { this.currentOrderedWaypointIndex = parseInt(ind) if (this.showInfoInChat.getValue()) ChatLib.chat(this.FeatureManager.messagePrefix + "Set index to " + ind + "!") @@ -353,6 +358,7 @@ class Waypoints extends Feature { this.registerEvent("worldLoad", () => { this.locations = {} + if (this.currentOrderedWaypointIndex >= 0) this.currentOrderedWaypointIndex = 0 }) } -- cgit