summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaLion <daleao.matheus@gmail.com>2022-12-07 18:13:17 -0300
committerDaLion <daleao.matheus@gmail.com>2022-12-07 18:13:17 -0300
commit86607423916785ae7d0933436d8a755581f35b2b (patch)
tree75ccbe138ff8111fe5e1b26d8c2b2dd0442db3c7 /src
parent368b25b5411683192f4398616abed61441457799 (diff)
downloadSMAPI-86607423916785ae7d0933436d8a755581f35b2b.tar.gz
SMAPI-86607423916785ae7d0933436d8a755581f35b2b.tar.bz2
SMAPI-86607423916785ae7d0933436d8a755581f35b2b.zip
Replaced slingshot ID check with Type check.
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
index 88ddfe6b..99de01b9 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
@@ -104,9 +104,10 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
// weapons
if (ShouldGet(ItemType.Weapon))
{
- foreach (int id in this.TryLoad<int, string>("Data\\weapons").Keys)
+ var weaponsData = this.TryLoad<int, string>("Data\\weapons");
+ foreach (int id in weaponsData.Keys)
{
- yield return this.TryCreate(ItemType.Weapon, id, p => p.ID is >= 32 and <= 34
+ yield return this.TryCreate(ItemType.Weapon, id, p => weaponsData[p.ID].Split('/')[8] == "4"
? new Slingshot(p.ID)
: new MeleeWeapon(p.ID)
);