1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Replaced public artType member of ArtifactInstance with getter

This commit is contained in:
Ivan Savenko
2024-10-12 08:41:59 +00:00
parent 04ca8aca9f
commit c98ac01e7a
21 changed files with 78 additions and 72 deletions

View File

@ -775,13 +775,13 @@ void CGArtifact::initObj(vstd::RNG & rand)
storedArtifact = ArtifactUtils::createArtifact(ArtifactID());
cb->gameState()->map->addNewArtifactInstance(storedArtifact);
}
if(!storedArtifact->artType)
if(!storedArtifact->getType())
storedArtifact->setType(getArtifact().toArtifact());
}
if(ID == Obj::SPELL_SCROLL)
subID = 1;
assert(storedArtifact->artType);
assert(storedArtifact->getType());
assert(!storedArtifact->getParentNodes().empty());
//assert(storedArtifact->artType->id == subID); //this does not stop desync
@ -825,7 +825,7 @@ void CGArtifact::onHeroVisit(const CGHeroInstance * h) const
iw.type = EInfoWindowMode::AUTO;
iw.player = h->tempOwner;
if(storedArtifact->artType->canBePutAt(h))
if(storedArtifact->getType()->canBePutAt(h))
{
switch (ID.toEnum())
{