Skip to content
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
Copy Markdown
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