1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Prefer to pass CGameState as reference instead of pointer

This commit is contained in:
Ivan Savenko
2025-04-19 14:14:12 +03:00
parent ce436bd63e
commit 4d57a8ed36
67 changed files with 465 additions and 466 deletions

View File

@ -140,7 +140,7 @@ void ClientCommandManager::handleControlaiCommand(std::istringstream& singleWord
if(GAME->interface())
color = GAME->interface()->playerID;
for(auto & elem : GAME->server().client->gameState()->players)
for(auto & elem : GAME->server().client->gameState().players)
{
if(!elem.first.isValidPlayer()
|| elem.second.human
@ -557,7 +557,7 @@ void ClientCommandManager::giveTurn(const PlayerColor &colorIdentifier)
yt.player = colorIdentifier;
yt.queryID = QueryID::NONE;
ApplyClientNetPackVisitor visitor(*GAME->server().client, *GAME->server().client->gameState());
ApplyClientNetPackVisitor visitor(*GAME->server().client, GAME->server().client->gameState());
yt.visit(visitor);
}