Browse Source

Remove indirect calls to CSH from server handler itself

Ivan Savenko 1 year ago
parent
commit
a74d9791a1
1 changed files with 4 additions and 4 deletions
  1. 4 4
      client/CServerHandler.cpp

+ 4 - 4
client/CServerHandler.cpp

@@ -838,7 +838,7 @@ void CServerHandler::debugStartTest(std::string filename, bool save)
 	while(!settings["session"]["headless"].Bool() && !GH.windows().topWindow<CLobbyScreen>())
 		boost::this_thread::sleep_for(boost::chrono::milliseconds(50));
 
-	while(!mi || mapInfo->fileURI != CSH->mi->fileURI)
+	while(!mi || mapInfo->fileURI != mi->fileURI)
 	{
 		setMapInfo(mapInfo);
 		boost::this_thread::sleep_for(boost::chrono::milliseconds(50));
@@ -925,10 +925,10 @@ void CServerHandler::onDisconnected(const std::shared_ptr<INetworkConnection> &
 
 	if(client)
 	{
-		CSH->endGameplay();
+		endGameplay();
 		GH.defActionsDef = 63;
 		CMM->menu->switchToTab("main");
-		CSH->showServerError(CGI->generaltexth->translate("vcmi.server.errors.disconnected"));
+		showServerError(CGI->generaltexth->translate("vcmi.server.errors.disconnected"));
 	}
 	else
 	{
@@ -991,7 +991,7 @@ void CServerHandler::sendLobbyPack(const CPackForLobby & pack) const
 
 bool CServerHandler::inLobbyRoom() const
 {
-	return CSH->serverMode == EServerMode::LOBBY_HOST || CSH->serverMode == EServerMode::LOBBY_GUEST;
+	return serverMode == EServerMode::LOBBY_HOST || serverMode == EServerMode::LOBBY_GUEST;
 }
 
 bool CServerHandler::inGame() const