mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-04 22:14:25 +02:00
Merge pull request #4421 from SoundSSGood/endBattleConfirm-fix
endBattleConfirm crash fix
This commit is contained in:
commit
1b6fd45aa7
@ -447,16 +447,16 @@ void BattleResultProcessor::endBattleConfirm(const CBattleInfoCallback & battle)
|
|||||||
addArtifactToTransfer(packCommander, artSlot.first, artSlot.second.getArt());
|
addArtifactToTransfer(packCommander, artSlot.first, artSlot.second.getArt());
|
||||||
sendArtifacts(packCommander);
|
sendArtifacts(packCommander);
|
||||||
}
|
}
|
||||||
}
|
auto armyObj = battle.battleGetArmyObject(battle.otherSide(battleResult->winner));
|
||||||
auto armyObj = battle.battleGetArmyObject(battle.otherSide(battleResult->winner));
|
for(const auto & armySlot : armyObj->stacks)
|
||||||
for(const auto & armySlot : armyObj->stacks)
|
{
|
||||||
{
|
BulkMoveArtifacts packsArmy(finishingBattle->winnerHero->getOwner(), finishingBattle->loserHero->id, finishingBattle->winnerHero->id, false);
|
||||||
BulkMoveArtifacts packsArmy(finishingBattle->winnerHero->getOwner(), finishingBattle->loserHero->id, finishingBattle->winnerHero->id, false);
|
packsArmy.srcArtHolder = armyObj->id;
|
||||||
packsArmy.srcArtHolder = armyObj->id;
|
packsArmy.srcCreature = armySlot.first;
|
||||||
packsArmy.srcCreature = armySlot.first;
|
for(const auto & artSlot : armySlot.second->artifactsWorn)
|
||||||
for(const auto & artSlot : armySlot.second->artifactsWorn)
|
addArtifactToTransfer(packsArmy, artSlot.first, armySlot.second->getArt(artSlot.first));
|
||||||
addArtifactToTransfer(packsArmy, artSlot.first, armySlot.second->getArt(artSlot.first));
|
sendArtifacts(packsArmy);
|
||||||
sendArtifacts(packsArmy);
|
}
|
||||||
}
|
}
|
||||||
// Display loot
|
// Display loot
|
||||||
if(!arts.empty())
|
if(!arts.empty())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user