aboutsummaryrefslogtreecommitdiff
path: root/features/events
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-23 22:21:23 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-23 22:21:23 +0800
commitfe3449248bb556779fc1ef8ee216efeda43e8592 (patch)
treec96fe6a66e8f9ea7a519e1027572b3d8ae53e331 /features/events
parenta0158cef8a59537145286ad96fd3daafc5238cf8 (diff)
downloadSoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.tar.gz
SoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.tar.bz2
SoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.zip
add error handling to registering forge event, and other fixes and cleanups
Diffstat (limited to 'features/events')
-rw-r--r--features/events/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/features/events/index.js b/features/events/index.js
index 99b5d2c..bbe1b6d 100644
--- a/features/events/index.js
+++ b/features/events/index.js
@@ -23,6 +23,7 @@ class Events extends Feature {
}
this.lastRequestTime = 0
this.nextUpdateApprox = -1
+ this.lastWorldChange = 0
this.lastRequest = 0
this.potentialParticleLocs = {}
this.showingWaypoints = false
@@ -138,7 +139,7 @@ class Events extends Feature {
}
})
- let showingWaypointsNew = hasDianaShovle && this.FeatureManager.features["dataLoader"].class.area === "Hub" && this.burrialWaypointsEnabled.getValue()
+ let showingWaypointsNew = (this.lastWorldChange+5000<Date.now()?hasDianaShovle && this.FeatureManager.features["dataLoader"].class.area === "Hub" && this.burrialWaypointsEnabled.getValue():this.showingWaypoints)
if(!this.showingWaypoints && showingWaypointsNew){
this.loadApi()
@@ -175,9 +176,9 @@ class Events extends Feature {
this.burrialData.locations = []
this.burrialData.historicalLocations = []
- this.showingWaypoints = false
-
this.nextUpdateApprox = Date.now()
+
+ this.lastWorldChange = Date.now()
}
loadApi(){