summaryrefslogtreecommitdiff
path: root/src/SMAPI/Metadata/CoreAssetPropagator.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-15 00:04:00 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-15 00:04:00 -0500
commit18a5b07c5ba277e4ea424228a9148e498e0361fa (patch)
tree9d876f5c816df944ae798c0d8737625d3074683d /src/SMAPI/Metadata/CoreAssetPropagator.cs
parent4aa2c0c3ec429c26da247089cf7fac631db30a0b (diff)
downloadSMAPI-18a5b07c5ba277e4ea424228a9148e498e0361fa.tar.gz
SMAPI-18a5b07c5ba277e4ea424228a9148e498e0361fa.tar.bz2
SMAPI-18a5b07c5ba277e4ea424228a9148e498e0361fa.zip
fix overeager asset propagation for bundles
Diffstat (limited to 'src/SMAPI/Metadata/CoreAssetPropagator.cs')
-rw-r--r--src/SMAPI/Metadata/CoreAssetPropagator.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs
index 97093636..a684b473 100644
--- a/src/SMAPI/Metadata/CoreAssetPropagator.cs
+++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs
@@ -239,11 +239,13 @@ namespace StardewModdingAPI.Metadata
int rewardsCount = pair.Value.Split('/')[2].Split(' ').Length;
// add bundles
- if (bundles.TryGetValue(bundleKey, out bool[] values))
+ if (!bundles.TryGetValue(bundleKey, out bool[] values) || values.Length < rewardsCount)
+ {
+ values ??= new bool[0];
+
bundles.Remove(bundleKey);
- else
- values = new bool[0];
- bundles[bundleKey] = values.Concat(Enumerable.Repeat(false, rewardsCount - values.Length)).ToArray();
+ bundles[bundleKey] = values.Concat(Enumerable.Repeat(false, rewardsCount - values.Length)).ToArray();
+ }
// add bundle rewards
if (!rewards.ContainsKey(bundleKey))