Skip to content

Commit

Permalink
- Fixed the Gourmand Frog checks sometimes missing the first check
Browse files Browse the repository at this point in the history
  • Loading branch information
agilbert1412 committed Oct 22, 2024
1 parent 5426a8f commit 5bdf069
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ public static bool GiveReward_GourmandCheckInsteadOfNuts_Prefix(IslandFarmCave _
++__instance.gourmandRequestsFulfilled.Value;
for (var i = 0; i < __instance.gourmandRequestsFulfilled.Value; i++)
{
_locationChecker.AddWalnutCheckedLocation(gourmandChecks[__instance.gourmandRequestsFulfilled.Value]);
if (i >= gourmandChecks.Length)
{
continue;
}
_locationChecker.AddWalnutCheckedLocation(gourmandChecks[i]);
}

Game1.player.team.MarkCollectedNut($"IslandGourmand{__instance.gourmandRequestsFulfilled.Value}");
Expand Down
14 changes: 7 additions & 7 deletions StardewArchipelago/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
using StardewValley;
using StardewValley.Delegates;
using StardewValley.Internal;
using StardewValley.Locations;
using StardewValley.TerrainFeatures;
using StardewValley.Triggers;

Expand Down Expand Up @@ -491,16 +492,15 @@ private void DoArchipelagoDayStartedProcesses()

private void DoBugsCleanup()
{
if (_archipelago.SlotData.Mods.HasMod(ModNames.ARCHAEOLOGY))
var islandFarmCave = (IslandFarmCave)Game1.getLocationFromName("IslandFarmCave");
var gourmandChecks = new[] { "Gourmand Frog Melon", "Gourmand Frog Wheat", "Gourmand Frog Garlic" };
for (var i = 0; i < islandFarmCave.gourmandRequestsFulfilled.Value; i++)
{
if (_locationChecker.IsLocationNotChecked("Read Digging Like Worms"))
if (i >= gourmandChecks.Length)
{
_locationChecker.AddCheckedLocation("Read Digging Like Worms");
}
if (_locationChecker.IsLocationNotChecked("Shipsanity: Digging Like Worms"))
{
_locationChecker.AddCheckedLocation("Shipsanity: Digging Like Worms");
continue;
}
_locationChecker.AddWalnutCheckedLocation(gourmandChecks[i]);
}
}

Expand Down

0 comments on commit 5bdf069

Please sign in to comment.