Skip to content

[Submerged Crab pot] Luremaster causes visual bug #237

@anderdot

Description

@anderdot

The mod wasn't submerging the crab pots due to a lack of bait, however I have the lure master profession.
I solved it with the code below, which can be implemented in the next version.

private const int LuremasterProfessionId = 11;

	private static bool HasEffectiveBait(CrabPot pot)
	{
		if (pot.bait.Value is not null)
			return true;

		return Game1.player is not null && Game1.player.professions.Contains(LuremasterProfessionId);
	}

	public class CrabPot_draw_Patch
	{
		public static bool Prefix(CrabPot __instance, SpriteBatch spriteBatch, int x, int y, ref float ___yBob, Vector2 ___shake)
		{
			bool hasCatch = __instance.heldObject.Value is not null || __instance.readyForHarvest.Value;
			bool shouldSubmerge = hasCatch || HasEffectiveBait(__instance);

			if (!Config.EnableMod || !shouldSubmerge || (hasCatch && __instance.heldObject.Value is not null && !Config.SubmergeHarvestable))
				return true;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions