1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fixed commander always dies.

This commit is contained in:
AlexVinS
2016-10-02 17:15:25 +03:00
parent 5fa9d64d78
commit 723734fd04

View File

@@ -6237,7 +6237,7 @@ CasualtiesAfterBattle::CasualtiesAfterBattle(const CArmedInstance * _army, Battl
if(c) if(c)
{ {
auto h = dynamic_cast <const CGHeroInstance *>(army); auto h = dynamic_cast <const CGHeroInstance *>(army);
if (h && h->commander == c) if(h && h->commander == c && (st->count == 0 || !st->alive()))
{ {
logGlobal->debug("Commander is dead."); logGlobal->debug("Commander is dead.");
heroWithDeadCommander = army->id; //TODO: unify commander handling heroWithDeadCommander = army->id; //TODO: unify commander handling