Ensure all players are considered local in local game.

Took 10 minutes
This commit is contained in:
Lukas Brübach 2025-09-10 03:25:31 +02:00
parent d4a5bb3a79
commit 65a492aeb9
2 changed files with 8 additions and 0 deletions

View file

@ -672,6 +672,9 @@ Player *TabGame::addPlayer(Player *newPlayer)
if (game->getGameState()->getIsLocalGame() ||
(game->getPlayerManager()->isLocalPlayer(newPlayer->getPlayerInfo()->getId()) &&
!game->getPlayerManager()->isSpectator())) {
if (game->getGameState()->getIsLocalGame()) {
newPlayer->getPlayerInfo()->setLocal(true);
}
addLocalPlayer(newPlayer, newPlayer->getPlayerInfo()->getId());
}

View file

@ -32,6 +32,11 @@ public:
return userInfo;
}
void setLocal(bool _local)
{
local = _local;
}
bool getLocal() const
{
return local;