1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

Merge pull request #4310 from SoundSSGood/endBattleConfirm-fix

Fixed regression from https://github.com/vcmi/vcmi/pull/4186
This commit is contained in:
Ivan Savenko
2024-07-20 22:20:46 +03:00
committed by GitHub

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)
{