mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-21 21:17:49 +02:00
Fix bug 803
This commit is contained in:
parent
5b836f428a
commit
4f2bc1cc35
@ -421,23 +421,10 @@ void CGameHandler::endBattle(int3 tile, const CGHeroInstance *hero1, const CGHer
|
|||||||
const CGHeroInstance *winnerHero = battleResult.data->winner != 0 ? hero2 : hero1;
|
const CGHeroInstance *winnerHero = battleResult.data->winner != 0 ? hero2 : hero1;
|
||||||
const CGHeroInstance *loserHero = battleResult.data->winner != 0 ? hero1 : hero2;
|
const CGHeroInstance *loserHero = battleResult.data->winner != 0 ? hero1 : hero2;
|
||||||
|
|
||||||
if (winnerHero)
|
const CStackBasicDescriptor raisedStack = winnerHero ? winnerHero->calculateNecromancy(*battleResult.data) : CStackBasicDescriptor();
|
||||||
{
|
// Give raised units to winner and show dialog, if any were raised,
|
||||||
CStackBasicDescriptor raisedStack = winnerHero->calculateNecromancy(*battleResult.data);
|
// units will be given after casualities are taken
|
||||||
|
const TSlot necroSlot = raisedStack.type ? winnerHero->getSlotFor(raisedStack.type) : -1;
|
||||||
// Give raised units to winner and show dialog, if any were raised.
|
|
||||||
if (raisedStack.type)
|
|
||||||
{
|
|
||||||
TSlot slot = winnerHero->getSlotFor(raisedStack.type);
|
|
||||||
|
|
||||||
if (slot != -1)
|
|
||||||
{
|
|
||||||
winnerHero->showNecromancyDialog(raisedStack);
|
|
||||||
addToSlot(StackLocation(winnerHero, slot), raisedStack.type, raisedStack.count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(!duel)
|
if(!duel)
|
||||||
{
|
{
|
||||||
@ -464,6 +451,11 @@ void CGameHandler::endBattle(int3 tile, const CGHeroInstance *hero1, const CGHer
|
|||||||
afterBattleCallback();
|
afterBattleCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (necroSlot != -1)
|
||||||
|
{
|
||||||
|
winnerHero->showNecromancyDialog(raisedStack);
|
||||||
|
addToSlot(StackLocation(winnerHero, necroSlot), raisedStack.type, raisedStack.count);
|
||||||
|
}
|
||||||
sendAndApply(&resultsApplied);
|
sendAndApply(&resultsApplied);
|
||||||
|
|
||||||
if(duel)
|
if(duel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user