Explorar o código

Fix segfault when non-hero forces win

Vadim Markovtsev %!s(int64=9) %!d(string=hai) anos
pai
achega
2a6a8cd433
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      server/CGameHandler.cpp

+ 1 - 1
server/CGameHandler.cpp

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