瀏覽代碼

Fix endBattleConfirm

SoundSSGood 1 年之前
父節點
當前提交
186c6098e8
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      server/battles/BattleResultProcessor.cpp

+ 6 - 3
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)
 			{