summaryrefslogtreecommitdiff
path: root/server/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/game.cpp')
-rw-r--r--server/game.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/server/game.cpp b/server/game.cpp
index 819336a..e791379 100644
--- a/server/game.cpp
+++ b/server/game.cpp
@@ -325,6 +325,14 @@ void Game::handle_action_discard(Action action, int player) {
}
}
+Tiles merge_hand_open(const Tiles& hand, const Sets& open) {
+ Tiles tiles = hand;
+ for(Sets::const_iterator it = open.begin(); it != open.end(); it++) {
+ tiles.insert(tiles.end(), it->tiles.begin(), it->tiles.end());
+ }
+ return tiles;
+}
+
void Game::round_end(Endcondition end) {
Message::RoundEnd::p msg[4] = make_shared<Message::RoundEnd>();
@@ -344,7 +352,7 @@ void Game::round_end(Endcondition end) {
case Tsumo: {
Player& player = players[current_player];
- msg[count_player]->hand = player.hand;
+ msg[count_player]->hand = merge_hand_open(player.hand, player.open);
msg[count_player]->yakus = player.won_han;
@@ -380,7 +388,7 @@ void Game::round_end(Endcondition end) {
if(players[current_player + i].won) {
Player& player = players[current_player + i];
- msg[count_player]->hand = player.hand;
+ msg[count_player]->hand = merge_hand_open(player.hand, player.open);
msg[count_player]->yakus = player.won_han;