fix mod type defaulted incorrectly in SMAPI toolkit
This commit is contained in:
parent
822cc71619
commit
b2a6933efb
|
@ -11,6 +11,9 @@
|
||||||
* For players:
|
* For players:
|
||||||
* Fixed error running `install on Windows.bat` in very rare cases.
|
* Fixed error running `install on Windows.bat` in very rare cases.
|
||||||
|
|
||||||
|
* For modders:
|
||||||
|
* Fixed SMAPI toolkit defaulting the mod type to SMAPI if its `manifest.json` has neither `EntryDll` nor `ContentPackFor`. This only affects external tools, since SMAPI itself validates those fields separately.
|
||||||
|
|
||||||
## 3.9.1
|
## 3.9.1
|
||||||
Released 25 January 2021 for Stardew Valley 1.5.4 or later.
|
Released 25 January 2021 for Stardew Valley 1.5.4 or later.
|
||||||
|
|
||||||
|
|
|
@ -177,12 +177,17 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning
|
||||||
}
|
}
|
||||||
|
|
||||||
// get mod type
|
// get mod type
|
||||||
ModType type = ModType.Invalid;
|
ModType type;
|
||||||
if (manifest != null)
|
|
||||||
{
|
{
|
||||||
type = !string.IsNullOrWhiteSpace(manifest.ContentPackFor?.UniqueID)
|
bool isContentPack = !string.IsNullOrWhiteSpace(manifest?.ContentPackFor?.UniqueID);
|
||||||
? ModType.ContentPack
|
bool isSmapi = !string.IsNullOrWhiteSpace(manifest?.EntryDll);
|
||||||
: ModType.Smapi;
|
|
||||||
|
if (isContentPack == isSmapi)
|
||||||
|
type = ModType.Invalid;
|
||||||
|
else if (isContentPack)
|
||||||
|
type = ModType.ContentPack;
|
||||||
|
else
|
||||||
|
type = ModType.Smapi;
|
||||||
}
|
}
|
||||||
|
|
||||||
// build result
|
// build result
|
||||||
|
|
Loading…
Reference in New Issue