summaryrefslogtreecommitdiff
path: root/server/player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/player.cpp')
-rw-r--r--server/player.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/player.cpp b/server/player.cpp
index 37dc3bc..554084d 100644
--- a/server/player.cpp
+++ b/server/player.cpp
@@ -99,6 +99,8 @@ bool Game::Player::can_riichi() {
Tiles tiles = hand;
+ tiles.sort();
+
// Take first tile out of the set.
Tile out = tiles.front();
tiles.erase(tiles.begin());
@@ -182,7 +184,9 @@ bool Game::Player::can_kan(Tile tile, int target) {
}
bool Game::Player::can_tsumo() {
- return Hand::agari(hand);
+ Tiles tiles = hand;
+ tiles.sort();
+ return Hand::agari(tiles);
}
bool Game::Player::can_ron(Tile tile) {