From aade41e0517b9a138f864070677973087df4b029 Mon Sep 17 00:00:00 2001 From: Anonymous Raccoon <32224410+AnonymusRaccoon@users.noreply.github.com> Date: Mon, 13 Aug 2018 14:13:43 +0200 Subject: [PATCH] sg --- Assets/Script/InventoryManager.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Assets/Script/InventoryManager.cs b/Assets/Script/InventoryManager.cs index 5c6d5c1..c2b18c7 100644 --- a/Assets/Script/InventoryManager.cs +++ b/Assets/Script/InventoryManager.cs @@ -72,9 +72,6 @@ public class InventoryManager : MonoBehaviour private bool CanPlantAt(int index, TreeItem item) { - print("Type: " + item.type); - print("Tree Type: " + (plots[index].treePlaced == TreeType.Nothing)); - print("Plot Type: " + ((plots[index].type & item.canBePlacedOn) != 0)); if (index != -1 && (plots[index].treePlaced == TreeType.Nothing || (plots[index].treePlaced & item.canOverrideTree) != 0) && (plots[index].type & item.canBePlacedOn) != 0) { return true; @@ -146,13 +143,13 @@ public class InventoryManager : MonoBehaviour { List freePlots = new List(); - if (i - 1 >= 0 && i % 5 != 0 && CanPlantAt(i - 1, items[(int)TreeType.TribbleTree])) + if (i - 1 >= 0 && i % 5 != 0 && CanPlantAt(i - 1, items[(int)TreeType.TribbleTree - 1])) freePlots.Add(i - 1); - if (i + 1 <= 24 && i % 5 != 4 && CanPlantAt(i + 1, items[(int)TreeType.TribbleTree])) + if (i + 1 <= 24 && i % 5 != 4 && CanPlantAt(i + 1, items[(int)TreeType.TribbleTree - 1])) freePlots.Add(i + 1); - if (i - 5 >= 0 && CanPlantAt(i - 5, items[(int)TreeType.TribbleTree])) + if (i - 5 >= 0 && CanPlantAt(i - 5, items[(int)TreeType.TribbleTree - 1])) freePlots.Add(i - 5); - if (i + 5 <= 24 && CanPlantAt(i + 5, items[(int)TreeType.TribbleTree])) + if (i + 5 <= 24 && CanPlantAt(i + 5, items[(int)TreeType.TribbleTree - 1])) freePlots.Add(i + 5); print(freePlots.Count);