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:
parent
355bf4ec3e
commit
786be6f253
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user