aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-09 19:58:26 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-09 19:58:26 +0800
commit5db44566ab59077701ad6ba40116335294865618 (patch)
treefe6d394e905baa722c0a6cd6c021a68cc2d57755 /features
parentbff09540fe80bdf1e809312a4709261168adc381 (diff)
downloadSoopyV2-5db44566ab59077701ad6ba40116335294865618.tar.gz
SoopyV2-5db44566ab59077701ad6ba40116335294865618.tar.bz2
SoopyV2-5db44566ab59077701ad6ba40116335294865618.zip
Reset globals correctly after gameunload
Diffstat (limited to 'features')
-rw-r--r--features/hud/index.js2
-rw-r--r--features/settings/settingsCommunicator.js8
2 files changed, 8 insertions, 2 deletions
diff --git a/features/hud/index.js b/features/hud/index.js
index 8e2b826..e703db5 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -269,7 +269,7 @@ class Hud extends Feature {
this.cpsElement.setText("&6Cps&7> &f" + cpsText)
//Scan opened inventory for all pet levels
- if(Player && Player.getOpenedInventory().getName().includes(") Pets")){
+ if(Player && Player.getOpenedInventory() && Player.getOpenedInventory().getName().includes(") Pets")){
let inv = Player.getOpenedInventory().getItems()
for(let i = 0; i < inv.length; i++){
if(inv[i]!=null && inv[i].getName().includes("[Lvl ")){
diff --git a/features/settings/settingsCommunicator.js b/features/settings/settingsCommunicator.js
index d0a55fc..053a7c1 100644
--- a/features/settings/settingsCommunicator.js
+++ b/features/settings/settingsCommunicator.js
@@ -24,6 +24,12 @@ class SettingsCommunicator {
}
}
-if(!global.soopyv2SettingsCommunicator) global.soopyv2SettingsCommunicator = new SettingsCommunicator()
+if(!global.soopyv2SettingsCommunicator){
+ global.soopyv2SettingsCommunicator = new SettingsCommunicator()
+
+ register("gameUnload", ()=>{
+ global.soopyv2SettingsCommunicator = undefined
+ })
+}
export default global.soopyv2SettingsCommunicator \ No newline at end of file