소스 검색

Merge pull request #6433 from mrhaandi/fix-onTileHovered-shutdown

Add ingame guard to `onTileHovered`
Ivan Savenko 1 주 전
부모
커밋
f01283338e
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      client/adventureMap/AdventureMapInterface.cpp

+ 3 - 1
client/adventureMap/AdventureMapInterface.cpp

@@ -603,7 +603,9 @@ void AdventureMapInterface::onTileHovered(const int3 &targetPosition)
 {
 	if(!shortcuts->optionMapViewActive())
 		return;
-
+	//if the player is not ingame (loser, winner, wrong) we are in a shutdown process
+	if (!GAME->interface()->cb || GAME->interface()->cb->getPlayerStatus(GAME->interface()->playerID) != EPlayerStatus::INGAME)
+		return;
 	//may occur just at the start of game (fake move before full initialization)
 	if(!GAME->interface()->localState->getCurrentArmy())
 		return;