diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-12-09 19:58:26 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-12-09 19:58:26 +0800 |
commit | 5db44566ab59077701ad6ba40116335294865618 (patch) | |
tree | fe6d394e905baa722c0a6cd6c021a68cc2d57755 /featureClass | |
parent | bff09540fe80bdf1e809312a4709261168adc381 (diff) | |
download | SoopyV2-5db44566ab59077701ad6ba40116335294865618.tar.gz SoopyV2-5db44566ab59077701ad6ba40116335294865618.tar.bz2 SoopyV2-5db44566ab59077701ad6ba40116335294865618.zip |
Reset globals correctly after gameunload
Diffstat (limited to 'featureClass')
-rw-r--r-- | featureClass/featureManager.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js index ee99199..95fba3c 100644 --- a/featureClass/featureManager.js +++ b/featureClass/featureManager.js @@ -463,7 +463,7 @@ class FeatureManager { } loadFeatureMetas(){ - featuresDir = new File("./config/ChatTriggers/modules/" + metadata.name + "/features") + let featuresDir = new File("./config/ChatTriggers/modules/" + metadata.name + "/features") featuresDir.list().forEach((pathName)=>{ if(pathName.includes(".")) return; @@ -475,7 +475,10 @@ class FeatureManager { } data.id = pathName this.featureMetas[pathName] = data - }catch(_){} + }catch(e){ + console.log("Error loading feature metadata for " + pathName) + console.log(JSON.stringify(e, undefined, 2)) + } }) } @@ -571,6 +574,9 @@ class FeatureManager { if(!global.soopyv2featuremanagerthing){ global.soopyv2featuremanagerthing = new FeatureManager() + register("gameUnload", ()=>{ + global.soopyv2featuremanagerthing = undefined + }) } export default global.soopyv2featuremanagerthing |