1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fix processing of VCMI_Tests map

This commit is contained in:
Ivan Savenko
2023-03-14 21:48:39 +02:00
parent 06e5d37fbd
commit d2152d387f
2 changed files with 20 additions and 4 deletions

View File

@@ -156,6 +156,7 @@ void ClientCommandManager::processCommand(const std::string &message, bool calle
// }
else if(message=="convert txt")
{
logGlobal->info("Searching for available maps");
std::unordered_set<ResourceID> mapList = CResourceHandler::get()->getFilteredFiles([&](const ResourceID & ident)
{
return ident.getType() == EResType::MAP;
@@ -168,9 +169,21 @@ void ClientCommandManager::processCommand(const std::string &message, bool calle
CMapService mapService;
logGlobal->info("Loading maps for export");
for (auto const & mapName : mapList)
mapService.loadMap(mapName); // load and drop loaded map - we only need loader to run over all maps
{
try
{
// load and drop loaded map - we only need loader to run over all maps
mapService.loadMap(mapName);
}
catch(std::exception & e)
{
logGlobal->error("Map %s is invalid. Message: %s", mapName.getName(), e.what());
}
}
logGlobal->info("Loading campaigns for export");
for (auto const & campaignName : campaignList)
{
CCampaignState state(CCampaignHandler::getCampaign(campaignName.getName()));