fix a captured loop variable

This commit is contained in:
Jesse Plamondon-Willard 2020-10-28 18:20:41 -04:00
parent f9f3db7db0
commit 295c34d5cd
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 8 additions and 8 deletions

View File

@ -161,7 +161,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
// fruit products
case SObject.FruitsCategory:
// wine
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 2 + id, _ => new SObject(348, 1)
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 2 + item.ParentSheetIndex, _ => new SObject(348, 1)
{
Name = $"{item.Name} Wine",
Price = item.Price * 3,
@ -170,7 +170,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
});
// jelly
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 3 + id, _ => new SObject(344, 1)
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 3 + item.ParentSheetIndex, _ => new SObject(344, 1)
{
Name = $"{item.Name} Jelly",
Price = 50 + item.Price * 2,
@ -182,7 +182,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
// vegetable products
case SObject.VegetableCategory:
// juice
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 4 + id, _ => new SObject(350, 1)
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 4 + item.ParentSheetIndex, _ => new SObject(350, 1)
{
Name = $"{item.Name} Juice",
Price = (int)(item.Price * 2.25d),
@ -191,7 +191,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
});
// pickled
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + id, _ => new SObject(342, 1)
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + item.ParentSheetIndex, _ => new SObject(342, 1)
{
Name = $"Pickled {item.Name}",
Price = 50 + item.Price * 2,
@ -202,7 +202,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
// flower honey
case SObject.flowersCategory:
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + id, _ =>
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + item.ParentSheetIndex, _ =>
{
SObject honey = new SObject(Vector2.Zero, 340, $"{item.Name} Honey", false, true, false, false)
{
@ -215,7 +215,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
break;
// roe and aged roe (derived from FishPond.GetFishProduce)
case SObject.sellAtFishShopCategory when id == 812:
case SObject.sellAtFishShopCategory when item.ParentSheetIndex == 812:
foreach (var pair in Game1.objectInformation)
{
// get input
@ -226,7 +226,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
// yield roe
SObject roe = null;
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 7 + id, _ =>
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 7 + item.ParentSheetIndex, _ =>
{
roe = new ColoredObject(812, 1, color)
{
@ -241,7 +241,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
// aged roe
if (roe != null && pair.Key != 698) // aged sturgeon roe is caviar, which is a separate item
{
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 7 + id, _ => new ColoredObject(447, 1, color)
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 7 + item.ParentSheetIndex, _ => new ColoredObject(447, 1, color)
{
name = $"Aged {input.Name} Roe",
Category = -27,