Fixed error in Splatoon 2 schedule data if Salmon Run has special weapons.

This commit is contained in:
flash 2024-04-12 00:24:54 +00:00
parent 4f1a8c43ab
commit 069ac97f71

View file

@ -16,11 +16,11 @@ class Splatoon2Weapon implements ISplatoonWeapon {
public function getName(): string {
return $this->locale->getString(
sprintf('weapons:%s:name', $this->weaponInfo['id']),
$this->weaponInfo['weapon']['name']
$this->weaponInfo['weapon']['name'] ?? $this->weaponInfo['coop_special_weapon']['name']
);
}
public function getImage(): string {
return $this->weaponInfo['weapon']['image'];
return $this->weaponInfo['weapon']['image'] ?? $this->weaponInfo['coop_special_weapon']['image'];
}
}