diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-01-20 01:01:26 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-02-07 22:42:02 -0500 |
commit | 59bc63cab6cd7fa80a4f46734fdaafde80e5b351 (patch) | |
tree | 5b786c73ffee1f49b471c1950a5be646cedb2cb8 /src/SMAPI | |
parent | 782dc6f3060ce37e080e279e6c5e68b28b2b1e79 (diff) | |
download | SMAPI-59bc63cab6cd7fa80a4f46734fdaafde80e5b351.tar.gz SMAPI-59bc63cab6cd7fa80a4f46734fdaafde80e5b351.tar.bz2 SMAPI-59bc63cab6cd7fa80a4f46734fdaafde80e5b351.zip |
propagate asset changes into the save file being loaded
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Metadata/CoreAssetPropagator.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index d83fc748..92968271 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -677,7 +677,13 @@ namespace StardewModdingAPI.Metadata /// <summary>Get all locations in the game.</summary> private IEnumerable<GameLocation> GetLocations() { - foreach (GameLocation location in Game1.locations) + // get available root locations + IEnumerable<GameLocation> rootLocations = Game1.locations; + if (SaveGame.loaded?.locations != null) + rootLocations = rootLocations.Concat(SaveGame.loaded.locations); + + // yield root + child locations + foreach (GameLocation location in rootLocations) { yield return location; |