mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 00:42:19 -07:00
[Server/Client] Fix open_decklists not showing for already-loaded decks on join
Took 6 minutes
This commit is contained in:
parent
83920a4ae9
commit
235c59f815
2 changed files with 6 additions and 1 deletions
|
|
@ -287,6 +287,9 @@ void GameEventHandler::eventGameStateChanged(const Event_GameStateChanged &event
|
|||
if (!game->getGameMetaInfo()->proto().share_decklists_on_load()) {
|
||||
continue;
|
||||
}
|
||||
if (!playerInfo.has_deck_list()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
opponentDecksToDisplay.append(
|
||||
qMakePair(playerId, qMakePair(playerName, QString::fromStdString(playerInfo.deck_list()))));
|
||||
|
|
|
|||
|
|
@ -1631,7 +1631,9 @@ void Server_AbstractPlayer::getInfo(ServerInfo_Player *info,
|
|||
{
|
||||
getProperties(*info->mutable_properties(), withUserInfo);
|
||||
|
||||
if (deck) {
|
||||
// Deck lists are only shared with other players when the game is in Open Decklists mode,
|
||||
// so a player joining an open lobby can see every deck that was loaded before they joined.
|
||||
if (deck && (recipient == this || game->getShareDecklistsOnLoad())) {
|
||||
info->set_deck_list(deck->writeToString_Native().toStdString());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue