aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-04-04 17:30:29 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-04-04 17:30:29 +0800
commit63e7b19f1c7d1447a2c09be258b3aef69cf00450 (patch)
tree19959a8c78c60c991e7a147cb30432557162e199 /features
parentd7dd016c1f4e4732dae6f4eb718fefa24462704b (diff)
downloadSoopyV2-63e7b19f1c7d1447a2c09be258b3aef69cf00450.tar.gz
SoopyV2-63e7b19f1c7d1447a2c09be258b3aef69cf00450.tar.bz2
SoopyV2-63e7b19f1c7d1447a2c09be258b3aef69cf00450.zip
make pet level show "??" instead of undefined if level is unknown
Diffstat (limited to 'features')
-rw-r--r--features/hud/index.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/features/hud/index.js b/features/hud/index.js
index 41aa953..b0995cb 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -225,8 +225,8 @@ class Hud extends Feature {
this.lastSwappedPet = Date.now()
})
this.registerChat("&r&aYou summoned your &r${pet}&r&a!&r", (pet)=>{
- this.petElement.setText("&6Pet&7> &7[Lvl " + this.petLevels[pet.replace("&", "§")] +"] "+pet)
- this.petText = "&6Pet&7> &7[Lvl " + this.petLevels[pet.replace("&", "§")] +"] "+pet
+ this.petElement.setText("&6Pet&7> &7[Lvl " + (this.petLevels[pet.replace("&", "§")]||"??") +"] "+pet)
+ this.petText = "&6Pet&7> &7[Lvl " + (this.petLevels[pet.replace("&", "§")]||"??") +"] "+pet
this.lastSwappedPet = Date.now()
})
@@ -237,8 +237,8 @@ class Hud extends Feature {
this.lastSwappedPet = Date.now()
})
this.registerChat("&r&aYour &r${pet} &r&alevelled up to level &r&9${level}&r&a!&r", (pet, level)=>{
- this.petElement.setText("&6Pet&7> &7[Lvl " + level +"] "+pet)
- this.petText = "&6Pet&7> &7[Lvl " + level +"] "+pet
+ this.petElement.setText("&6Pet&7> &7[Lvl " + (level||"??") +"] "+pet)
+ this.petText = "&6Pet&7> &7[Lvl " + (level||"??") +"] "+pet
this.lastSwappedPet = Date.now()
})
@@ -616,8 +616,8 @@ class Hud extends Feature {
"MYTHIC": "&d"
}
- this.petElement.setText("&6Pet&7> &7[Lvl " + pet.level.level + "] " + petTierColor[pet.tier] + pet.name)
- this.petText = "&6Pet&7> &7[Lvl " + pet.level.level + "] " + petTierColor[pet.tier] + pet.name
+ this.petElement.setText("&6Pet&7> &7[Lvl " + (pet.level.level||"??") + "] " + petTierColor[pet.tier] + pet.name)
+ this.petText = "&6Pet&7> &7[Lvl " + (pet.level.level||"??") + "] " + petTierColor[pet.tier] + pet.name
}
worldLoad(){