fixed #62: shuffling doesn't reveal the top card even if AlwaysRevealTopCard is set
This commit is contained in:
parent
886f12d116
commit
4c9165f099
1 changed files with 12 additions and 2 deletions
|
@ -774,13 +774,23 @@ Response::ResponseCode Server_Player::cmdShuffle(const Command_Shuffle & /*cmd*/
|
||||||
return Response::RespGameNotStarted;
|
return Response::RespGameNotStarted;
|
||||||
if (conceded)
|
if (conceded)
|
||||||
return Response::RespContextError;
|
return Response::RespContextError;
|
||||||
|
|
||||||
zones.value("deck")->shuffle();
|
Server_CardZone *deckZone = zones.value("deck");
|
||||||
|
deckZone->shuffle();
|
||||||
|
|
||||||
Event_Shuffle event;
|
Event_Shuffle event;
|
||||||
event.set_zone_name("deck");
|
event.set_zone_name("deck");
|
||||||
ges.enqueueGameEvent(event, playerId);
|
ges.enqueueGameEvent(event, playerId);
|
||||||
|
|
||||||
|
if (deckZone->getAlwaysRevealTopCard() && !deckZone->cards.isEmpty()) {
|
||||||
|
Event_RevealCards revealEvent;
|
||||||
|
revealEvent.set_zone_name(deckZone->getName().toStdString());
|
||||||
|
revealEvent.set_card_id(0);
|
||||||
|
deckZone->cards.first()->getInfo(revealEvent.add_cards());
|
||||||
|
|
||||||
|
ges.enqueueGameEvent(revealEvent, playerId);
|
||||||
|
}
|
||||||
|
|
||||||
return Response::RespOk;
|
return Response::RespOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue