Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug where hover-text isn't shown for indoor pots when they are placed on flooring #638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions UIInfoSuite2/UIElements/ShowCropAndBarrelTime.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -111,20 +111,17 @@ private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e)
_currentTerrain.Value = terrain;
}

// Make sure that _terrain is null before overwriting it because Tea Saplings are added to terrainFeatures and not IndoorPot.bush
if (_currentTerrain.Value != null || _currentTile.Value is not IndoorPot pot)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real essence of the change is to remove "_currentTerrain.Value != null ||". (everything else is just syntax).

As best I can tell, TeaBushes used to work very differently from everything else back in the day. But now things are a whole lot simpler. I've been able to test this in several saves with tea bushes but don't have one handy where the tea bushes are supposed to be harvestable.

if (_currentTile.Value is IndoorPot pot)
{
return;
}

if (pot.hoeDirt.Value != null)
{
_currentTerrain.Value = pot.hoeDirt.Value;
}
if (pot.hoeDirt.Value != null)
{
_currentTerrain.Value = pot.hoeDirt.Value;
}

if (pot.bush.Value != null)
{
_currentTerrain.Value = pot.bush.Value;
if (pot.bush.Value != null)
{
_currentTerrain.Value = pot.bush.Value;
}
}
}

Expand Down