From 749bfdb24a8e7c32490aeed3bfe7c8eb1e3a5165 Mon Sep 17 00:00:00 2001 From: Joshua Navarro Date: Fri, 6 Jan 2017 23:38:28 -0800 Subject: [PATCH] Fixed some removal issues with the trackedTerrainFeatures List --- Revitalize/Revitalize/Revitalize/Class1.cs | 2 +- Revitalize/Revitalize/Revitalize/Serialize.cs | 20 ++++++++++++++++++- Revitalize/Revitalize/Revitalize/Util.cs | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Revitalize/Revitalize/Revitalize/Class1.cs b/Revitalize/Revitalize/Revitalize/Class1.cs index 8a5a57c1..11af5bcd 100644 --- a/Revitalize/Revitalize/Revitalize/Class1.cs +++ b/Revitalize/Revitalize/Revitalize/Class1.cs @@ -76,7 +76,7 @@ namespace Revitalize if (Game1.player.isMoving() == true && hasLoadedTerrainList == false) { Lists.loadAllLists(); - Log.AsyncC("CHEEZNIPS!"); + // Log.AsyncC("CHEEZNIPS!"); Util.WaterAllCropsInAllLocations(); } diff --git a/Revitalize/Revitalize/Revitalize/Serialize.cs b/Revitalize/Revitalize/Revitalize/Serialize.cs index feaf50c1..b8ee7415 100644 --- a/Revitalize/Revitalize/Revitalize/Serialize.cs +++ b/Revitalize/Revitalize/Revitalize/Serialize.cs @@ -850,7 +850,25 @@ namespace Revitalize public static void serializeTrackedTerrainDataNodeList(List list) { Lists.trackedTerrainFeaturesDummyList.Clear(); - foreach(var v in list) + List removalList = new List(); + foreach (var v in Lists.trackedTerrainFeatures) + { + if ((v.terrainFeature as HoeDirt).crop == null) + { + removalList.Add(v); + // Log.AsyncR("WHY REMOVE???"); + continue; + } + + } + + foreach(var v in removalList) + { + Lists.trackedTerrainFeatures.Remove(v); + } + removalList.Clear(); + + foreach (var v in list) { Lists.trackedTerrainFeaturesDummyList.Add(new TrackedTerrainDummyDataNode(v.location.name, v.position)); } diff --git a/Revitalize/Revitalize/Revitalize/Util.cs b/Revitalize/Revitalize/Revitalize/Util.cs index c91c15cc..36fd0d01 100644 --- a/Revitalize/Revitalize/Revitalize/Util.cs +++ b/Revitalize/Revitalize/Revitalize/Util.cs @@ -706,7 +706,7 @@ namespace Revitalize public static void WaterAllCropsInAllLocations() { - Game1.weatherForTomorrow = Game1.weather_rain; + // Game1.weatherForTomorrow = Game1.weather_rain; List removalList = new List(); if (Game1.isRaining)