1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Use ArtifactInstanceID in CGArtifact

This commit is contained in:
Ivan Savenko
2025-03-18 20:38:12 +00:00
parent ab11d2b075
commit 16a06179cf
11 changed files with 53 additions and 39 deletions

View File

@@ -167,7 +167,7 @@ void MapController::repairMap(CMap * map)
//fix spell scrolls
if(auto * art = dynamic_cast<CGArtifact*>(obj))
{
if(art->ID == Obj::SPELL_SCROLL && !art->storedArtifact)
if(art->ID == Obj::SPELL_SCROLL && !art->getArtifactInstance())
{
std::vector<SpellID> out;
for(auto const & spell : LIBRARY->spellh->objects) //spellh size appears to be greater (?)
@@ -178,7 +178,7 @@ void MapController::repairMap(CMap * map)
}
}
auto a = map->createScroll(*RandomGeneratorUtil::nextItem(out, CRandomGenerator::getDefault()));
art->storedArtifact = a;
art->setArtifactInstance(a);
}
}
//fix mines