diff options
-rw-r--r-- | server/game.cpp | 12 | ||||
-rw-r--r-- | server/wall.cpp | 2 |
2 files changed, 11 insertions, 3 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; diff --git a/server/wall.cpp b/server/wall.cpp index 714e519..42df094 100644 --- a/server/wall.cpp +++ b/server/wall.cpp @@ -27,7 +27,7 @@ int Wall::remaining() { } Tile Wall::take_one() { - return wall.front(); + //return wall.front(); boost::uniform_int<> range(0, wall.size() - 1); |