summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/game.cpp14
-rw-r--r--server/game.h2
2 files changed, 9 insertions, 7 deletions
diff --git a/server/game.cpp b/server/game.cpp
index 3fd7961..ab61a7d 100644
--- a/server/game.cpp
+++ b/server/game.cpp
@@ -135,7 +135,7 @@ void Game::round_update_discard() {
Actions a;
if(player != current_player) {
- if(a = players[player].get_actions_discard(discarded_tile)) {
+ if(a = players[player].get_actions_discard(discarded_tile, current_player + player)) {
possible_actions[player] = a;
}
}
@@ -307,15 +307,17 @@ Actions Game::Player::get_actions_draw() {
return possible_actions;
}
-Actions Game::Player::get_actions_discard(Tile tile) {
+Actions Game::Player::get_actions_discard(Tile tile, PlayerNum discarder) {
Actions possible_actions;
if(!riichi) {
// Check if tile can be called for a chi. Enumerate all combinations.
- Targets targets = can_chi(tile);
- if(!targets.empty()) {
- for(Targets::iterator it = targets.begin(); it != targets.end(); it++) {
- possible_actions.push_back(Action(Action::Chi, Action::Hand, *it));
+ if(discarder == 3) {
+ Targets targets = can_chi(tile);
+ if(!targets.empty()) {
+ for(Targets::iterator it = targets.begin(); it != targets.end(); it++) {
+ possible_actions.push_back(Action(Action::Chi, Action::Hand, *it));
+ }
}
}
diff --git a/server/game.h b/server/game.h
index 1e293f6..c327e66 100644
--- a/server/game.h
+++ b/server/game.h
@@ -46,7 +46,7 @@ class Game : public boost::enable_shared_from_this<Game> {
Actions get_actions_draw();
//! Get possible actions on discarded tile.
- Actions get_actions_discard(Tile tile);
+ Actions get_actions_discard(Tile tile, PlayerNum discarder);
typedef std::vector<int> Targets;