Skip to content

Commit

Permalink
fix: limit input type to object (gottyduke#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
gottyduke authored Apr 18, 2024
1 parent 386bd68 commit bd50eae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Informant/Implementation/Decorator/BundleDecorator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Xna.Framework.Graphics;
using Slothsoft.Informant.Api;
using Slothsoft.Informant.Helper;
using StardewValley.Extensions;
using StardewValley.Locations;
using Color = Microsoft.Xna.Framework.Color;
using Rectangle = Microsoft.Xna.Framework.Rectangle;
Expand Down Expand Up @@ -35,6 +36,11 @@ public BundleDecorator(IModHelper modHelper)

public bool HasDecoration(Item input)
{
if (!input.HasTypeObject()) {
// gotta be an object
return false;
}

if (Game1.MasterPlayer.hasOrWillReceiveMail("JojaMember")) {
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions Informant/Implementation/Decorator/ShippingBinDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public bool HasDecoration(Item input)

private static int? CalculateStillNeeded(Item input)
{
if (input is not SObject obj || !SObject.isPotentialBasicShipped(input.ItemId, input.Category, obj.Type)) {
return null;
}

var itemId = input.ItemId;
var trackingType = InformantMod.Instance?.Config.ShippingBinTracking ?? ShippingBinTrackingType.Collection;
// 15 of each crop
Expand Down
2 changes: 1 addition & 1 deletion Informant/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Informant",
"Author": "Slothsoft",
"Version": "1.8.2",
"Version": "1.8.3",
"Description": "Displays additional information on various objects.",
"UniqueID": "Slothsoft.Informant",
"EntryDll": "Informant.dll",
Expand Down

0 comments on commit bd50eae

Please sign in to comment.