diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-03-22 19:52:42 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-03-22 19:52:42 -0400 |
commit | 7ca5efbbc576f3c6c43493654b2a0ac040fd4f31 (patch) | |
tree | fae7a4e06a14ff7f8d709e2f4d5b8b92b8784a37 /src/SMAPI/Patches | |
parent | 5ae640dc91adff8dfb0827e2a3c3f6b54be7c612 (diff) | |
parent | 6d1494a56c5d04e7bc1ee406810a5a53dea2229a (diff) | |
download | SMAPI-7ca5efbbc576f3c6c43493654b2a0ac040fd4f31.tar.gz SMAPI-7ca5efbbc576f3c6c43493654b2a0ac040fd4f31.tar.bz2 SMAPI-7ca5efbbc576f3c6c43493654b2a0ac040fd4f31.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Patches')
-rw-r--r-- | src/SMAPI/Patches/LoadErrorPatch.cs | 25 |
1 files changed, 1 insertions, 24 deletions
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<GameLocation> 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; } - /// <summary>Remove locations which don't exist in-game.</summary> - /// <param name="locations">The current game locations.</param> - private static bool RemoveInvalidLocations(List<GameLocation> 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; - } - /// <summary>Remove buildings which don't exist in the game data.</summary> /// <param name="locations">The current game locations.</param> private static bool RemoveBrokenBuildings(IEnumerable<GameLocation> locations) |