Skip to content

Commit

Permalink
validateCampaignMod: Additional sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Oct 24, 2024
1 parent adcadc8 commit 91fb3a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/titleui/campaign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 91fb3a1

Please sign in to comment.