Fixed Tomato farming (again)

This commit is contained in:
2025-09-17 15:07:17 +02:00
parent 975dd45c94
commit 2cb605261e
9 changed files with 57 additions and 29 deletions
@@ -81,7 +81,7 @@ public partial class FieldBehaviour2D : Sprite2D
int currentSlotIndex = InventoryManager.Instance.CurrentSelectedSlotIndex;
ItemInstance? item = InventoryManager.Instance.playerInventory.Slots[currentSlotIndex].itemInstance;
if (item == null || PlantingPlaceholder.GetChildCount() > 0)
if (item == null || PlantingPlaceholder.GetChildCount() > 0 || item.amount == 0)
return success;
string prefabPath = ItemRepository.TryGetPrefabPath(item.blueprint);
@@ -98,7 +98,8 @@ public partial class FieldBehaviour2D : Sprite2D
{
plantBehaviour.Field = this;
}
InventoryManager.Instance.playerInventory.RemoveItem(currentSlotIndex);
success = true;
}