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

Remove artifact from slot as reward

This commit is contained in:
Ivan Savenko
2025-05-01 21:02:56 +03:00
parent 6688d28198
commit 0212b6e37d
9 changed files with 72 additions and 2 deletions

View File

@ -184,6 +184,16 @@ void Rewardable::Interface::grantRewardAfterLevelup(const Rewardable::VisitInfo
cb->removeArtifact(ArtifactLocation(hero->id, hero->getArtPos(art, false)));
}
for(const ArtifactPosition & slot : info.reward.takenArtifactSlots)
{
const auto & slotContent = hero->getSlot(slot);
if (!slotContent->locked && slotContent->artifactID.hasValue())
cb->removeArtifact(ArtifactLocation(hero->id, slot));
// TODO: handle locked slots?
}
for(const SpellID & spell : info.reward.scrolls)
cb->giveHeroNewScroll(hero, spell, ArtifactPosition::FIRST_AVAILABLE);