remove invalid-location check now handled by the game

This commit is contained in:
Jesse Plamondon-Willard
2020-03-22 19:27:08 -04:00
parent 107232ae43
commit 737e31b531
2 changed files with 2 additions and 24 deletions
+1
View File
@@ -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:
+1 -24
View File
@@ -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)