diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/hud/index.js | 2 | ||||
-rw-r--r-- | features/settings/settingsCommunicator.js | 8 |
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 |