From 91fb3a1dd3302ea49292198d75ed1fad4f3a983a Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:05:14 -0400 Subject: [PATCH] validateCampaignMod: Additional sanity check --- src/titleui/campaign.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/titleui/campaign.cpp b/src/titleui/campaign.cpp index c7133954240..b3820bbcb89 100644 --- a/src/titleui/campaign.cpp +++ b/src/titleui/campaign.cpp @@ -134,6 +134,16 @@ static bool validateCampaignMod(WzCampaignModInfo& modInfo, const std::string& b } } + // Verify alternate campaign has at least one campaign file listed + if (modInfo.type == WzModType::AlternateCampaign) + { + if (modInfo.campaignFiles.empty()) + { + debug(LOG_ERROR, "Alternate campaign mod must list one or more valid campaign JSON files in \"campaigns\": %s", realModFilePathAndName.c_str()); + return false; + } + } + return true; }