diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-12-24 18:36:26 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-12-24 18:36:26 +0800 |
commit | 6695867c01a718d20800394fe0685fba598e57b6 (patch) | |
tree | a21d75aab9eb16e6a18f027ffe2e421522a96541 /features | |
parent | d945fb03938e9d8f174c8b48a6a53469efa12d88 (diff) | |
download | SoopyV2-6695867c01a718d20800394fe0685fba598e57b6.tar.gz SoopyV2-6695867c01a718d20800394fe0685fba598e57b6.tar.bz2 SoopyV2-6695867c01a718d20800394fe0685fba598e57b6.zip |
fix potential error with deloading essential cosmetics
Diffstat (limited to 'features')
-rw-r--r-- | features/cosmetics/cosmetic/dragon/dragonWings.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/features/cosmetics/cosmetic/dragon/dragonWings.js b/features/cosmetics/cosmetic/dragon/dragonWings.js index ee6b055..88018a9 100644 --- a/features/cosmetics/cosmetic/dragon/dragonWings.js +++ b/features/cosmetics/cosmetic/dragon/dragonWings.js @@ -348,20 +348,24 @@ class DragonWings extends Cosmetic { let wingCosmetic = this.player.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.WINGS) if(wingCosmetic !== null){ - this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(wingCosmetic)).getModel().getModel().boneList.forEach(b=>{ - b.isHidden = true - this.parent.hiddenEssentialCosmetics.push(b) - }) + if(this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(wingCosmetic))){ + this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(wingCosmetic)).getModel().getModel().boneList.forEach(b=>{ + b.isHidden = true + this.parent.hiddenEssentialCosmetics.push(b) + }) + } }else{ let fullBodyCosmetic = this.player.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.FULL_BODY) if(fullBodyCosmetic === "DRAGON_ONESIE_2"){ - this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(fullBodyCosmetic)).getModel().getModel().boneList.forEach(b=>{ - if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1"){ - b.isHidden = true - - this.parent.hiddenEssentialCosmetics.push(b) - } - }) + if(this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(fullBodyCosmetic))){ + this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(fullBodyCosmetic)).getModel().getModel().boneList.forEach(b=>{ + if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1"){ + b.isHidden = true + + this.parent.hiddenEssentialCosmetics.push(b) + } + }) + } } } } |