Don't get local ID from playerInfo.

Took 39 minutes


Took 39 seconds
This commit is contained in:
Lukas Brübach 2025-09-14 21:04:08 +02:00
parent ab6b32b8ba
commit b4984ff31d

View file

@ -68,7 +68,13 @@ Player *PlayerManager::getPlayer(int playerId) const
void PlayerManager::onPlayerConceded(int playerId, bool conceded) void PlayerManager::onPlayerConceded(int playerId, bool conceded)
{ {
// GameEventHandler cares about this for sending the concede/unconcede commands // GameEventHandler cares about this for sending the concede/unconcede commands
if (playerId == getActiveLocalPlayer(playerId)->getPlayerInfo()->getId()) { if (game->getGameState()->getIsLocalGame()) {
if (conceded) {
emit activeLocalPlayerConceded();
} else {
emit activeLocalPlayerUnconceded();
}
} else if (playerId == localPlayerId) {
if (conceded) { if (conceded) {
emit activeLocalPlayerConceded(); emit activeLocalPlayerConceded();
} else { } else {