1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fix double free in battleAfterLevelUp() in case of a draw

This commit is contained in:
Vadim Markovtsev 2016-01-24 01:31:39 +03:00
parent 2a6a8cd433
commit 7185890723

View File

@ -741,7 +741,7 @@ void CGameHandler::battleAfterLevelUp( const BattleResult &result )
sendAndApply(&sah);
}
if(finishingBattle->winnerHero && finishingBattle->winnerHero->stacks.empty())
if(result.winner != 2 && finishingBattle->winnerHero && finishingBattle->winnerHero->stacks.empty())
{
RemoveObject ro(finishingBattle->winnerHero->id);
sendAndApply(&ro);