1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +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

@ -152,10 +152,10 @@ void CArtifactsOfHeroQuickBackpack::setHero(const CGHeroInstance * hero)
std::map<const ArtifactID, const CArtifactInstance*> filteredArts;
for(auto & slotInfo : curHero->artifactsInBackpack)
if(slotInfo.artifact->getTypeId() != artInSlotId && !slotInfo.artifact->isScroll() &&
slotInfo.artifact->getType()->canBePutAt(curHero, filterBySlot, true))
if(slotInfo.getArt()->getTypeId() != artInSlotId && !slotInfo.getArt()->isScroll() &&
slotInfo.getArt()->getType()->canBePutAt(curHero, filterBySlot, true))
{
filteredArts.insert(std::pair(slotInfo.artifact->getTypeId(), slotInfo.artifact));
filteredArts.insert(std::pair(slotInfo.getArt()->getTypeId(), slotInfo.getArt()));
}
std::map<const SpellID, const CArtifactInstance*> filteredScrolls;
@ -164,8 +164,8 @@ void CArtifactsOfHeroQuickBackpack::setHero(const CGHeroInstance * hero)
{
for(auto & slotInfo : curHero->artifactsInBackpack)
{
if(slotInfo.artifact->isScroll() && slotInfo.artifact->getScrollSpellID() != scrollInSlotSpellId)
filteredScrolls.insert(std::pair(slotInfo.artifact->getScrollSpellID(), slotInfo.artifact));
if(slotInfo.getArt()->isScroll() && slotInfo.getArt()->getScrollSpellID() != scrollInSlotSpellId)
filteredScrolls.insert(std::pair(slotInfo.getArt()->getScrollSpellID(), slotInfo.getArt()));
}
}