summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-12-10 03:42:13 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-12-10 03:42:13 +0100
commit0913dec10964f02a0b813181bb2a076d814b2909 (patch)
tree36a0a29c6393300b9cf7754a8ae575990018fae6 /server
parent1c4b618bde3cb82957364319d0dc982716bf1bf9 (diff)
Implemented "atama hane"-rule on multiple ron.
Diffstat (limited to 'server')
-rw-r--r--server/game.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/game.cpp b/server/game.cpp
index 565468b..5a27eea 100644
--- a/server/game.cpp
+++ b/server/game.cpp
@@ -249,13 +249,21 @@ void Game::handle_action_discard(Action action, int player) {
break;
}
- case Action::Ron:
+ // First ron.
if(action.type == Action::Ron) {
// TODO: Handle simultanous ron.
preceding_action = action;
preceding_action_owner = player;
break;
}
+
+ // Multiple ron.
+ case Action::Ron:
+ if(action.type == Action::Ron && current_player - player > current_player - preceding_action_owner) {
+ preceding_action = action;
+ preceding_action_owner = player;
+ break;
+ }
break;
// Will never occur on discard: