1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

respect headeronly

This commit is contained in:
Laserlicht 2024-08-10 13:57:13 +02:00
parent be61daa95a
commit b16f721b39

View File

@ -608,6 +608,9 @@ std::vector< std::vector<ui8> > CampaignHandler::getFile(std::unique_ptr<CInputS
auto data = loader.load(resource)->readAll();
ret.push_back(std::vector<ui8>(data.first.get(), data.first.get() + data.second));
if(headerOnly)
return ret;
// load scenarios
JsonNode header(reinterpret_cast<const std::byte*>(data.first.get()), data.second, VCMP_HEADER_FILE_NAME);
for(auto scenario : header["scenarios"].Vector())