Skip to content

[Bug] Immersive Sprinklers play watering animation but do not water normal HoeDirt tiles #243

Description

@daviamaroo14-bot

Describe the bug
Immersive sprinklers correctly trigger their watering animation (both when activated manually via the activation key or overnight when passing the day), but the actual ground tiles (HoeDirt) remain dry and unwatered.

Cause of the bug
In Methods.cs, inside the ActivateSprinkler method, the mod relies on the vanilla method obj.ApplySprinkler(tile);. However, in Stardew Valley 1.6, this native game method fails to apply the watered state if the sprinkler object isn't registered in the location's standard objects list (since this mod stores them inside modData).

While you successfully handled a similar issue manually for IndoorPot objects within that same loop, standard ground HoeDirt terrain features were left out.

Suggested Fix
Inside Methods.cs -> ActivateSprinkler, we can explicitly look up the HoeDirt in terrainFeatures and force its state value to 1 (watered), exactly like the workaround used for indoor pots.

Here is the corrected foreach loop block:

foreach (Vector2 tile in GetSprinklerTiles(tileLocation, radius))
{
    obj.ApplySprinkler(tile);
    
    // Fix: Explicitly update normal ground HoeDirt state to watered
    if (environment.terrainFeatures.TryGetValue(tile, out var tf) && tf is HoeDirt hoeDirt)
    {
        hoeDirt.state.Value = 1;
    }

    // Existing IndoorPot logic
    if (environment.objects.TryGetValue(tile, out var o) && o is IndoorPot)
    {
        (o as IndoorPot).hoeDirt.Value.state.Value = 1;
        o.showNextIndex.Value = 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