1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +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

@@ -1208,7 +1208,7 @@ void RemoveObject::applyGs(CGameState *gs)
beatenHero->tempOwner = PlayerColor::NEUTRAL; //no one owns beaten hero
vstd::erase_if(beatenHero->artifactsInBackpack, [](const ArtSlotInfo& asi)
{
return asi.artifact->artType->getId() == ArtifactID::GRAIL;
return asi.artifact->getTypeId() == ArtifactID::GRAIL;
});
if(beatenHero->visitedTown)
@@ -1733,7 +1733,7 @@ void BulkEraseArtifacts::applyGs(CGameState *gs)
const auto slotInfo = artSet->getSlot(slot);
if(slotInfo->locked)
{
logGlobal->debug("Erasing locked artifact: %s", slotInfo->artifact->artType->getNameTranslated());
logGlobal->debug("Erasing locked artifact: %s", slotInfo->artifact->getType()->getNameTranslated());
DisassembledArtifact dis;
dis.al.artHolder = artHolder;
@@ -1747,12 +1747,12 @@ void BulkEraseArtifacts::applyGs(CGameState *gs)
}
}
assert((dis.al.slot != ArtifactPosition::PRE_FIRST) && "Failed to determine the assembly this locked artifact belongs to");
logGlobal->debug("Found the corresponding assembly: %s", artSet->getArt(dis.al.slot)->artType->getNameTranslated());
logGlobal->debug("Found the corresponding assembly: %s", artSet->getArt(dis.al.slot)->getType()->getNameTranslated());
dis.applyGs(gs);
}
else
{
logGlobal->debug("Erasing artifact %s", slotInfo->artifact->artType->getNameTranslated());
logGlobal->debug("Erasing artifact %s", slotInfo->artifact->getType()->getNameTranslated());
}
gs->map->removeArtifactInstance(*artSet, slot);
}
@@ -1840,8 +1840,8 @@ void AssembledArtifact::applyGs(CGameState *gs)
break;
}
if(!vstd::contains(combinedArt->artType->getPossibleSlots().at(hero->bearerType()), al.slot)
&& vstd::contains(combinedArt->artType->getPossibleSlots().at(hero->bearerType()), slot))
if(!vstd::contains(combinedArt->getType()->getPossibleSlots().at(hero->bearerType()), al.slot)
&& vstd::contains(combinedArt->getType()->getPossibleSlots().at(hero->bearerType()), slot))
al.slot = slot;
}
else
@@ -1857,7 +1857,7 @@ void AssembledArtifact::applyGs(CGameState *gs)
const auto constituentInstance = hero->getArt(slot);
gs->map->removeArtifactInstance(*hero, slot);
if(!combinedArt->artType->isFused())
if(!combinedArt->getType()->isFused())
{
if(ArtifactUtils::isSlotEquipment(al.slot) && slot != al.slot)
combinedArt->addPart(constituentInstance, slot);