Explorar el Código

Fix segfault when non-hero forces win

Vadim Markovtsev hace 9 años
padre
commit
2a6a8cd433
Se han modificado 1 ficheros con 1 adiciones y 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);