1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Fix endBattleConfirm

This commit is contained in:
SoundSSGood 2024-07-20 15:07:34 +03:00
parent 3c611ffa5b
commit 186c6098e8

View File

@ -425,10 +425,13 @@ void BattleResultProcessor::endBattleConfirm(const CBattleInfoCallback & battle)
if(finishingBattle->loserHero)
{
packHero.srcArtHolder = finishingBattle->loserHero->id;
for(const auto & artSlot : finishingBattle->loserHero->artifactsWorn)
for(const auto & slot : ArtifactUtils::commonWornSlots())
{
if(ArtifactUtils::isArtRemovable(artSlot))
addArtifactToTransfer(packHero, artSlot.first, artSlot.second.getArt());
if(const auto artSlot = finishingBattle->loserHero->artifactsWorn.find(slot);
artSlot != finishingBattle->loserHero->artifactsWorn.end() && ArtifactUtils::isArtRemovable(*artSlot))
{
addArtifactToTransfer(packHero, artSlot->first, artSlot->second.getArt());
}
}
for(const auto & artSlot : finishingBattle->loserHero->artifactsInBackpack)
{