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

Implemented mod-friendly loading of town building icons for campaigns

This commit is contained in:
Ivan Savenko
2025-06-13 21:31:41 +03:00
parent ba0188ca7f
commit 0fa83c0478
28 changed files with 379 additions and 539 deletions

View File

@@ -269,12 +269,13 @@ void CArtifactsOfHeroBase::setSlotData(ArtPlacePtr artPlace, const ArtifactPosit
artPlace->slot = slot;
if(auto slotInfo = curHero->getSlot(slot))
{
const auto curArt = slotInfo->getArt();
artPlace->lockSlot(slotInfo->locked);
artPlace->setArtifact(slotInfo->getArt()->getTypeId(), slotInfo->getArt()->getScrollSpellID());
artPlace->setArtifact(curArt->getTypeId(), curArt->getScrollSpellID());
if(slotInfo->locked)
return;
const auto curArt = slotInfo->getArt();
// If the artifact has charges, add charges information
if(curArt->getType()->isCharged())
artPlace->addChargedArtInfo(curArt->getCharges());