Content Patcher

Content Patcher

460k Downloads

[Lookup Anything] Missing info on Largemouth Bass

gr3ger opened this issue ยท 5 comments

commented

Describe the bug
Largemouth Bass (and maybe more pages?) does not have any data showing season/time/location of availability like other fish do.
If I find the problem I'll make a PR, but I'm just creating an issue just in case since I don't know when I'll be able to sit down and take a look at it.

To Reproduce

  1. Shift+F1 and search for largemouth bass
  2. everything besides how to get the fish is shown

Log file
https://smapi.io/log/c43f52aaebcf49309552b5eebfd49c27

Screenshots
image

EDIT:
Seems like this issue happens with all fish that don't care about seasons. I've added further info down below in the comments.

commented

Updated the log with one with a leaner modlist. Issue persists regardless though.

commented

image
It does have tags for lake, all seasons, and no weather favorability at least. It just doesn't show in-game.

commented

It seems like the Largemouth bass falls under a third state that the current if/elseif doesn't capture here:

if (fish.Season.HasValue)
{
curLocations.Add(new FishSpawnLocationData(locationName, fish.FishAreaId, new[] { fish.Season.Value.ToString() }));
}
else if (fish.Condition != null)
{
var conditionData = GameStateQuery.Parse(fish.Condition);
var seasonalConditions = conditionData.Where(condition => GameStateQuery.SeasonQueryKeys.Contains(condition.Query[0]));
foreach (GameStateQuery.ParsedGameStateQuery condition in seasonalConditions)
{
var seasons = new List<string>();
foreach (string season in new[] { "spring", "summer", "fall", "winter" })
{
if (!condition.Negated && condition.Query.Any(word => word.Equals(season, StringComparison.OrdinalIgnoreCase)))
seasons.Add(season);
}
curLocations.Add(new FishSpawnLocationData(locationName, fish.FishAreaId, seasons.ToArray()));
}
}

I've just done some quick probing.
But the current code detects that it should spawn in Mountain and Backwoods (?) during the first phase, but fails to actually add any locations to the list due to the season/condition checks.

commented

I think I may have narrowed it down.
Bullhead and Carp exhibit the same issues.

So I think all fish with no season constraints have empty locations in the mod.
Adding a third "else" to handle such cases could work if there's a way to validate that the locations are actually correct.

commented

My fix got merged, so closing issue :)