diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-28 21:21:18 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-28 21:21:18 -0500 |
commit | b2a6933efb0719b48034eff8c29b5f12beb00248 (patch) | |
tree | 39cb1ea71461fce10d738795f45f6b1fa0e02a65 /src | |
parent | 822cc71619cd173a67de241843cf1679cfc1904d (diff) | |
download | SMAPI-b2a6933efb0719b48034eff8c29b5f12beb00248.tar.gz SMAPI-b2a6933efb0719b48034eff8c29b5f12beb00248.tar.bz2 SMAPI-b2a6933efb0719b48034eff8c29b5f12beb00248.zip |
fix mod type defaulted incorrectly in SMAPI toolkit
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs index 86a97016..fd206d9d 100644 --- a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -177,12 +177,17 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning } // get mod type - ModType type = ModType.Invalid; - if (manifest != null) + ModType type; { - type = !string.IsNullOrWhiteSpace(manifest.ContentPackFor?.UniqueID) - ? ModType.ContentPack - : ModType.Smapi; + bool isContentPack = !string.IsNullOrWhiteSpace(manifest?.ContentPackFor?.UniqueID); + bool isSmapi = !string.IsNullOrWhiteSpace(manifest?.EntryDll); + + if (isContentPack == isSmapi) + type = ModType.Invalid; + else if (isContentPack) + type = ModType.ContentPack; + else + type = ModType.Smapi; } // build result |