diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/standard.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/server/standard.cpp b/server/standard.cpp index a45c018..7ffd6ac 100644 --- a/server/standard.cpp +++ b/server/standard.cpp @@ -148,9 +148,10 @@ State& Standard::round_update() { chi = true; } if(chi) { - temp_action.player = temp_next_player; - temp_action.target = tile_2u_id; - temp_action.type = Action::Chi; + temp_action.player = temp_next_player; + temp_action.target = tile_2u_id; + temp_action.target2 = tile_1u_id; + temp_action.type = Action::Chi; game_state.possible_actions.push_back(temp_action); #ifdef DEBUG @@ -173,9 +174,10 @@ State& Standard::round_update() { chi = true; } if(chi) { - temp_action.player = temp_next_player; - temp_action.target = tile_1u_id; - temp_action.type = Action::Chi; + temp_action.player = temp_next_player; + temp_action.target = tile_1u_id; + temp_action.target2 = tile_1o_id; + temp_action.type = Action::Chi; game_state.possible_actions.push_back(temp_action); #ifdef DEBUG @@ -199,9 +201,10 @@ State& Standard::round_update() { chi = true; } if(chi) { - temp_action.player = temp_next_player; - temp_action.target = tile_1o_id; - temp_action.type = Action::Chi; + temp_action.player = temp_next_player; + temp_action.target = tile_1o_id; + temp_action.target2 = tile_2o_id; + temp_action.type = Action::Chi; game_state.possible_actions.push_back(temp_action); #ifdef DEBUG @@ -380,17 +383,12 @@ bool Standard::round_action(Action action) { Tile middle_tile = game_state.players[action.player].hand[action.target]; chi.add_tile(middle_tile); - Tile right_tile; - if(Tile::Type(game_state.players[action.player].hand[action.target].type + 1) == left_tile.type) { - right_tile = game_state.players[action.player].hand[action.target + 2]; - } else { - right_tile = game_state.players[action.player].hand[action.target + 1]; - } + Tile right_tile = game_state.players[action.player].hand[action.target2]; chi.add_tile(right_tile); game_state.players[action.player].open.push_back(chi); game_state.players[action.player].hand.erase(game_state.players[action.player].hand.begin() + action.target); - game_state.players[action.player].hand.erase(game_state.players[action.player].hand.begin() + action.target); + game_state.players[action.player].hand.erase(game_state.players[action.player].hand.begin() + action.target2 - 1); } break; |