From 723734fd04655ec456fb52154073b54e29e759d7 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Sun, 2 Oct 2016 17:15:25 +0300 Subject: [PATCH] Fixed commander always dies. --- server/CGameHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 5ebab8d98..f67fac74f 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -6237,7 +6237,7 @@ CasualtiesAfterBattle::CasualtiesAfterBattle(const CArmedInstance * _army, Battl if(c) { auto h = dynamic_cast (army); - if (h && h->commander == c) + if(h && h->commander == c && (st->count == 0 || !st->alive())) { logGlobal->debug("Commander is dead."); heroWithDeadCommander = army->id; //TODO: unify commander handling