1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Remove pointers from artifacts

This commit is contained in:
Ivan Savenko
2025-03-30 23:09:43 +03:00
parent 4ed13409c2
commit d34b47bb20
29 changed files with 211 additions and 146 deletions

View File

@@ -144,18 +144,18 @@ bool Rewardable::Limiter::heroAllowed(const CGHeroInstance * hero) const
// check required amount of artifacts
size_t artCnt = 0;
for(const auto & [slot, slotInfo] : hero->artifactsWorn)
if(slotInfo.artifact->getTypeId() == elem.first)
if(slotInfo.getArt()->getTypeId() == elem.first)
artCnt++;
for(auto & slotInfo : hero->artifactsInBackpack)
if(slotInfo.artifact->getTypeId() == elem.first)
if(slotInfo.getArt()->getTypeId() == elem.first)
{
artCnt++;
}
else if(slotInfo.artifact->isCombined())
else if(slotInfo.getArt()->isCombined())
{
for(const auto & partInfo : slotInfo.artifact->getPartsInfo())
if(partInfo.art->getTypeId() == elem.first)
for(const auto & partInfo : slotInfo.getArt()->getPartsInfo())
if(partInfo.getArtifact()->getTypeId() == elem.first)
artCnt++;
}