Skip to content

Commit 27827c0

Browse files
author
aphadeon
committed
Prevent error spam if a crop doesnt match
1 parent 1291d85 commit 27827c0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Mod.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,15 @@ private void fixLocation( GameLocation loc )
503503
hd.crop = null;
504504
else
505505
{
506-
var key = cropIds.Last(x => x.Value == hd.crop.rowInSpriteSheet).Key;
507-
var c = crops.Last(x => x.Name == key);
508-
if (c != null) // Non-JA crop
509-
hd.crop.indexOfHarvest.Value = ResolveObjectId(c.Product);
506+
try
507+
{
508+
var key = cropIds.Last(x => x.Value == hd.crop.rowInSpriteSheet).Key;
509+
var c = crops.Last(x => x.Name == key);
510+
if (c != null) // Non-JA crop
511+
hd.crop.indexOfHarvest.Value = ResolveObjectId(c.Product);
512+
}
513+
catch { continue; }
514+
510515
}
511516
}
512517
else if (tf.Last().Value is FruitTree ft)

0 commit comments

Comments
 (0)