From 153b1207301a95a91e4ffc59f6f94e8d09f2142e Mon Sep 17 00:00:00 2001 From: bradjrenshaw Date: Thu, 12 May 2022 20:05:01 -0400 Subject: [PATCH] Added old mariner to npcs category when present. --- stardew-access/Features/TileInfo.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/stardew-access/Features/TileInfo.cs b/stardew-access/Features/TileInfo.cs index 716d9c8..665a836 100644 --- a/stardew-access/Features/TileInfo.cs +++ b/stardew-access/Features/TileInfo.cs @@ -47,16 +47,15 @@ namespace stardew_access.Features (string? name, CATEGORY category) staticTile = MainClass.STiles.getStaticTileInfoAtWithCategory(x, y); string? bush = getBushAtTile(x, y, lessInfo); - if (Game1.currentLocation.isCharacterAtTile(tile) != null) + if (Game1.currentLocation.isCharacterAtTile(tile) is NPC npc) { - NPC npc = Game1.currentLocation.isCharacterAtTile(tile); - toReturn = npc.displayName; + toReturn = npc.displayName; if (npc.isVillager() || npc.CanSocialize) category = CATEGORY.Farmers; else category = CATEGORY.NPCs; } - else if (farmAnimal != null) + else if (farmAnimal != null) { toReturn = farmAnimal; category = CATEGORY.FarmAnimals; @@ -408,7 +407,11 @@ namespace stardew_access.Features } else if (Game1.currentLocation is Beach beach) { - if (x == 58 && y == 13) + if (MainClass.ModHelper.Reflection.GetField(beach, "oldMariner").GetValue() is NPC mariner && mariner.getTileLocation() == new Vector2(x, y)) + { + return (CATEGORY.NPCs, "Old Mariner"); + } + else if (x == 58 && y == 13) { if (!beach.bridgeFixed.Value) return (CATEGORY.Interactables, "Repair Bridge");