mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix build
This commit is contained in:
@@ -683,7 +683,13 @@ void MapController::modAssessmentObject(const CGObjectInstance * obj, ModCompati
|
||||
|
||||
for(const auto & spellID : town->obligatorySpells)
|
||||
{
|
||||
auto hero = dynamic_cast<CGHeroInstance *>(obj.get());
|
||||
extractEntityMod(spellID.toEntity(LIBRARY));
|
||||
}
|
||||
}
|
||||
|
||||
if(obj->ID == Obj::HERO || obj->ID == Obj::RANDOM_HERO)
|
||||
{
|
||||
auto hero = dynamic_cast<const CGHeroInstance *>(obj);
|
||||
for(const auto & spellID : hero->getSpellsInSpellbook())
|
||||
{
|
||||
if(spellID == SpellID::PRESET || spellID == SpellID::SPELLBOOK_PRESET)
|
||||
@@ -701,28 +707,6 @@ void MapController::modAssessmentObject(const CGObjectInstance * obj, ModCompati
|
||||
extractEntityMod(art.getArt()->getTypeId().toEntity(LIBRARY));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(obj->ID == Obj::HERO || obj->ID == Obj::RANDOM_HERO)
|
||||
{
|
||||
auto hero = dynamic_cast<const CGHeroInstance *>(obj);
|
||||
for(const auto & spellID : hero->getSpellsInSpellbook())
|
||||
{
|
||||
if(spellID == SpellID::PRESET || spellID == SpellID::SPELLBOOK_PRESET)
|
||||
continue;
|
||||
extractEntityMod(spellID.toEntity(LIBRARY));
|
||||
}
|
||||
|
||||
for(const auto & [_, slotInfo] : hero->artifactsWorn)
|
||||
{
|
||||
extractEntityMod(slotInfo.artifact->getTypeId().toEntity(LIBRARY));
|
||||
}
|
||||
|
||||
for(const auto & art : hero->artifactsInBackpack)
|
||||
{
|
||||
extractEntityMod(art.artifact->getTypeId().toEntity(LIBRARY));
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: terrains?
|
||||
}
|
||||
|
||||
@@ -614,7 +614,7 @@ void MapView::dropEvent(QDropEvent * event)
|
||||
if(sc->selectionObjectsView.newObject)
|
||||
{
|
||||
QString errorMsg;
|
||||
if(controller->canPlaceObject(sc->selectionObjectsView.newObject, errorMsg))
|
||||
if(controller->canPlaceObject(sc->selectionObjectsView.newObject.get(), errorMsg))
|
||||
{
|
||||
auto obj = sc->selectionObjectsView.newObject;
|
||||
controller->commitObjectCreate(sc->level);
|
||||
|
||||
Reference in New Issue
Block a user