diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-10-04 21:23:48 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-10-04 21:23:48 +0800 |
commit | 2d463dc118b0d73605906ae0c2e4419bf39e8571 (patch) | |
tree | da97464dadad112db7975c35fa931b4bd5ee9be6 /src/featureClass/featureManager.js | |
parent | 3a8cc7cc26ac3b48734b167d7ea2a6fef66cd513 (diff) | |
download | SoopyV2-2d463dc118b0d73605906ae0c2e4419bf39e8571.tar.gz SoopyV2-2d463dc118b0d73605906ae0c2e4419bf39e8571.tar.bz2 SoopyV2-2d463dc118b0d73605906ae0c2e4419bf39e8571.zip |
+ fix game freeze on first dungeon of the day
+ (potential) fix memory leak when doing lots of /ct reload
+ add seperate setting for powder info on hud to rest of powder features
Diffstat (limited to 'src/featureClass/featureManager.js')
-rw-r--r-- | src/featureClass/featureManager.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/featureClass/featureManager.js b/src/featureClass/featureManager.js index 6974f46..eb2f0f9 100644 --- a/src/featureClass/featureManager.js +++ b/src/featureClass/featureManager.js @@ -19,7 +19,7 @@ let CTRequire = new JSLoader.CTRequire(StrongCachingModuleScriptProvider) const System = Java.type("java.lang.System") let loadedModules = new Set() -let shouldRequireForceNoCache = true +let shouldRequireForceNoCache = false function RequireNoCache(place) { if (!shouldRequireForceNoCache) { @@ -566,10 +566,12 @@ class FeatureManager { if (!func) throw new Error("Function must not be null") this.customEvents[id] = { - func: func, - context: context, + func, + context, trigger: register(type, (...args) => { try { + if (this.customEvents[id]?.eventT && !this.customEvents[id].eventT.enabled) return + if (context.enabled) { if (this.recordingPerformanceUsage) this.startRecordingPerformance(context.getId(), type) let start = Date.now() @@ -587,7 +589,8 @@ class FeatureManager { soopyV2Server.reportError(e, "Error in " + type + " event.") } }), - id: id + id, + type, } return this.customEvents[id] |