summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-11-28 07:17:43 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-11-28 07:17:43 +0100
commit36ebdbc3b66c3772e4b4e7600e9de5cbb2d9c3a6 (patch)
tree00cd0e8302d16a4be2419de2c5127147e1aae1c1 /server
parent0eed6b15aad392797739f98313206b501b64085b (diff)
End the round when the wall is depleted.
Diffstat (limited to 'server')
-rw-r--r--server/game.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/game.cpp b/server/game.cpp
index 24de238..407df34 100644
--- a/server/game.cpp
+++ b/server/game.cpp
@@ -251,6 +251,13 @@ void Game::handle_action_discard(Action action, int player) {
switch(preceding_action.type) {
case Action::Pass: {
// Tile not claimed, next player draws.
+
+ // Check if the wall has run out.
+ if(wall.remaining() <= 14) {
+ round_end();
+ break;
+ }
+
players[++current_player].draw(wall.take_one());
round_update_draw();
} break;