From 069ac97f71697d5d30bdb60e540b037e58a81950 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 12 Apr 2024 00:24:54 +0000 Subject: [PATCH] Fixed error in Splatoon 2 schedule data if Salmon Run has special weapons. --- src/Splatoon/Splatoon2/Splatoon2Weapon.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Splatoon/Splatoon2/Splatoon2Weapon.php b/src/Splatoon/Splatoon2/Splatoon2Weapon.php index 954e24b..5b027b0 100644 --- a/src/Splatoon/Splatoon2/Splatoon2Weapon.php +++ b/src/Splatoon/Splatoon2/Splatoon2Weapon.php @@ -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']; } }