From 737e31b531e2064643e4c790673d5053afe683ae Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 22 Mar 2020 19:27:08 -0400 Subject: remove invalid-location check now handled by the game --- src/SMAPI/Patches/LoadErrorPatch.cs | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'src/SMAPI/Patches') diff --git a/src/SMAPI/Patches/LoadErrorPatch.cs b/src/SMAPI/Patches/LoadErrorPatch.cs index c16ca7cc..77415ff2 100644 --- a/src/SMAPI/Patches/LoadErrorPatch.cs +++ b/src/SMAPI/Patches/LoadErrorPatch.cs @@ -67,8 +67,7 @@ namespace StardewModdingAPI.Patches private static bool Before_SaveGame_LoadDataToLocations(List gamelocations) { bool removedAny = - LoadErrorPatch.RemoveInvalidLocations(gamelocations) - | LoadErrorPatch.RemoveBrokenBuildings(gamelocations) + LoadErrorPatch.RemoveBrokenBuildings(gamelocations) | LoadErrorPatch.RemoveInvalidNpcs(gamelocations); if (removedAny) @@ -77,28 +76,6 @@ namespace StardewModdingAPI.Patches return true; } - /// Remove locations which don't exist in-game. - /// The current game locations. - private static bool RemoveInvalidLocations(List locations) - { - bool removedAny = false; - - foreach (GameLocation location in locations.ToArray()) - { - if (location is Cellar) - continue; // missing cellars will be added by the game code - - if (Game1.getLocationFromName(location.name) == null) - { - LoadErrorPatch.Monitor.Log($"Removed invalid location '{location.Name}' to avoid a crash when loading save '{Constants.SaveFolderName}'. (Did you remove a custom location mod?)", LogLevel.Warn); - locations.Remove(location); - removedAny = true; - } - } - - return removedAny; - } - /// Remove buildings which don't exist in the game data. /// The current game locations. private static bool RemoveBrokenBuildings(IEnumerable locations) -- cgit