diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-21 18:06:23 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-21 18:06:23 -0400 |
commit | 7e7ac459a54a607de5843be37ea4b222058d5d3e (patch) | |
tree | b7b1d4fe11d1dd016e86fff03bf2244590b211c4 /src | |
parent | e6ef71bae149b0d94055141075a84783f91e7c52 (diff) | |
download | SMAPI-7e7ac459a54a607de5843be37ea4b222058d5d3e.tar.gz SMAPI-7e7ac459a54a607de5843be37ea4b222058d5d3e.tar.bz2 SMAPI-7e7ac459a54a607de5843be37ea4b222058d5d3e.zip |
fix error when mod localizes an unlocalizable asset and then stops doing so
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI/Framework/ContentCoordinator.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ContentCoordinator.cs b/src/SMAPI/Framework/ContentCoordinator.cs index dd3d2917..fc61b44b 100644 --- a/src/SMAPI/Framework/ContentCoordinator.cs +++ b/src/SMAPI/Framework/ContentCoordinator.cs @@ -407,6 +407,18 @@ namespace StardewModdingAPI.Framework } } + // forget localized flags + // A mod might provide a localized variant of a normally non-localized asset (like + // `Maps/MovieTheater.fr-FR`). When the asset is invalidated, we need to recheck + // whether the asset is localized in case it stops providing it. + foreach (IAssetName assetName in invalidatedAssets.Keys) + { + LocalizedContentManager.localizedAssetNames.Remove(assetName.Name); + + if (LocalizedContentManager.localizedAssetNames.TryGetValue(assetName.BaseName, out string? targetForBaseKey) && targetForBaseKey == assetName.Name) + LocalizedContentManager.localizedAssetNames.Remove(assetName.BaseName); + } + // special case: maps may be loaded through a temporary content manager that's removed while the map is still in use. // This notably affects the town and farmhouse maps. if (Game1.locations != null) |