diff --git a/server/battles/BattleResultProcessor.cpp b/server/battles/BattleResultProcessor.cpp index 90ce8fbc7..122ec9a7b 100644 --- a/server/battles/BattleResultProcessor.cpp +++ b/server/battles/BattleResultProcessor.cpp @@ -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) {