summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-03-22 19:27:08 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-03-22 19:27:08 -0400
commit737e31b531e2064643e4c790673d5053afe683ae (patch)
tree44d7de80e93499de695a5ff201e68413fd679afc
parent107232ae439c26459b08f20e17f7582077cb35ba (diff)
downloadSMAPI-737e31b531e2064643e4c790673d5053afe683ae.tar.gz
SMAPI-737e31b531e2064643e4c790673d5053afe683ae.tar.bz2
SMAPI-737e31b531e2064643e4c790673d5053afe683ae.zip
remove invalid-location check now handled by the game
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Patches/LoadErrorPatch.cs25
2 files changed, 2 insertions, 24 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 73fa8ed1..12ba056d 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -4,6 +4,7 @@
## Upcoming release
* For players:
* Fixed semi-transparency issues on Linux/Mac in recent versions of Mono (e.g. pink shadows).
+ * Removed invalid location check. This is now handled by the game itself.
* Updated translations. Thanks to Annosz (added Hungarian)!
* For the Console Commands mod:
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)