diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/game.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/game.cpp b/server/game.cpp index 56885c3..5319e1b 100644 --- a/server/game.cpp +++ b/server/game.cpp @@ -156,7 +156,7 @@ void Game::round_update_discard() { void Game::handle_action_draw(Action action) { switch(action.type) { case Action::Discard: { - players[current_player].discard(action.target); + players[current_player].discard(action.target_offset); round_update_discard(); } break; @@ -295,12 +295,12 @@ Actions Game::Player::get_actions_draw() { // List all tiles that can be discarded. for(std::size_t i = 0; i < hand.size(); i++) { - possible_actions.push_back(Action(Action::Discard, i)); + possible_actions.push_back(Action(Action::Discard, Action::Hand, i)); } } else { // Only tile that can be discarded is the last drawn one. - possible_actions.push_back(Action(Action::Discard, hand.size() - 1)); + possible_actions.push_back(Action(Action::Discard, Action::Hand, hand.size() - 1)); } return possible_actions; @@ -314,18 +314,18 @@ Actions Game::Player::get_actions_discard(Tile tile) { 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, *it)); + possible_actions.push_back(Action(Action::Chi, Action::Hand, *it)); } } // Check if tile can be called for a pon. int target = can_pon(tile); if(target > 0) { - possible_actions.push_back(Action(Action::Pon, target)); + possible_actions.push_back(Action(Action::Pon, Action::Hand, target + 1)); // Check if tile can be called for a kan. if(can_kan(tile, target)) { - possible_actions.push_back(Action(Action::Kan, target)); + possible_actions.push_back(Action(Action::Kan, Action::Hand, target + 2)); } } } |