Replaced slingshot ID check with Type check.

This commit is contained in:
DaLion 2022-12-07 18:13:17 -03:00
parent 368b25b541
commit 8660742391
1 changed files with 3 additions and 2 deletions

View File

@ -104,9 +104,10 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
// weapons // weapons
if (ShouldGet(ItemType.Weapon)) 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 Slingshot(p.ID)
: new MeleeWeapon(p.ID) : new MeleeWeapon(p.ID)
); );