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:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user