Browse Source

Fixed commander always dies.

AlexVinS 9 years ago
parent
commit
723734fd04
1 changed files with 1 additions and 1 deletions
  1. 1 1
      server/CGameHandler.cpp

+ 1 - 1
server/CGameHandler.cpp

@@ -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