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

map-editor: add hero placeholder with heroType defined to reservedCampaignHeroes on map save

This commit is contained in:
godric3 2024-08-22 16:53:43 +02:00
parent 355bf4ec3e
commit 786be6f253

View File

@ -452,6 +452,18 @@ void MainWindow::saveMap()
Translations::cleanupRemovedItems(*controller.map());
for(auto obj : controller.map()->objects)
{
if(obj->ID == Obj::HERO_PLACEHOLDER)
{
auto hero = dynamic_cast<CGHeroPlaceholder *>(obj.get());
if(hero->heroType.has_value())
{
controller.map()->reservedCampaignHeroes.insert(hero->heroType.value());
}
}
}
CMapService mapService;
try
{