summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/game.cpp46
1 files changed, 16 insertions, 30 deletions
diff --git a/server/game.cpp b/server/game.cpp
index 8e6f358..ed5bf3f 100644
--- a/server/game.cpp
+++ b/server/game.cpp
@@ -148,6 +148,10 @@ void Game::round_update() {
unsigned int count = 0, tile_2u_id,tile_1u_id,tile_1o_id,tile_2o_id;
Tile::Type check_tile;
for(it = game_state.players[temp_next_player].hand.begin(); it != game_state.players[temp_next_player].hand.end(); ++it) {
+ #ifdef DEBUG
+ Tile debug = *it;
+ #endif
+
check_tile = Tile::Type(temp_tile.type - 2);
if(it->type == check_tile) {
tile_2u = &(*it);
@@ -177,17 +181,11 @@ void Game::round_update() {
chi = false;
//Make sure we have a chi within the same series.
if(tile_2u->type <= Tile::Man_7 && tile_2u->type >= Tile::Man_1) {
- if(temp_tile.type <= Tile::Man_9 && temp_tile.type >= Tile::Man_3) {
- chi = true;
- }
+ chi = true;
} else if(tile_2u->type <= Tile::Pin_7 && tile_2u->type >= Tile::Pin_1) {
- if(temp_tile.type <= Tile::Pin_9 && temp_tile.type >= Tile::Pin_3) {
- chi = true;
- }
- } else if(tile_2u->type <= Tile::Sou_1 && tile_2u->type >= Tile::Sou_1) {
- if(temp_tile.type <= Tile::Sou_9 && temp_tile.type >= Tile::Sou_3) {
- chi = true;
- }
+ chi = true;
+ } else if(tile_2u->type <= Tile::Sou_7 && tile_2u->type >= Tile::Sou_1) {
+ chi = true;
}
if(chi) {
temp_action.player = temp_next_player;
@@ -208,17 +206,11 @@ void Game::round_update() {
chi = false;
//Make sure we have a chi within the same series.
if(tile_1u->type <= Tile::Man_7 && tile_1u->type >= Tile::Man_1) {
- if(tile_1o->type <= Tile::Man_9 && tile_1o->type >= Tile::Man_3) {
- chi = true;
- }
+ chi = true;
} else if(tile_1u->type <= Tile::Pin_7 && tile_1u->type >= Tile::Pin_1) {
- if(tile_1o->type <= Tile::Pin_9 && tile_1o->type >= Tile::Pin_3) {
- chi = true;
- }
- } else if(tile_1u->type <= Tile::Sou_1 && tile_1u->type >= Tile::Sou_1) {
- if(tile_1o->type <= Tile::Sou_9 && tile_1o->type >= Tile::Sou_3) {
- chi = true;
- }
+ chi = true;
+ } else if(tile_1u->type <= Tile::Sou_7 && tile_1u->type >= Tile::Sou_1) {
+ chi = true;
}
if(chi) {
temp_action.player = temp_next_player;
@@ -240,17 +232,11 @@ void Game::round_update() {
chi = false;
//Make sure we have a chi within the same series.
if(temp_tile.type <= Tile::Man_7 && temp_tile.type >= Tile::Man_1) {
- if(tile_2o->type <= Tile::Man_9 && tile_2o->type >= Tile::Man_3) {
- chi = true;
- }
+ chi = true;
} else if(temp_tile.type <= Tile::Pin_7 && temp_tile.type >= Tile::Pin_1) {
- if(tile_2o->type <= Tile::Pin_9 && tile_2o->type >= Tile::Pin_3) {
- chi = true;
- }
- } else if(temp_tile.type <= Tile::Sou_1 && temp_tile.type >= Tile::Sou_1) {
- if(tile_2o->type <= Tile::Sou_9 && tile_2o->type >= Tile::Sou_3) {
- chi = true;
- }
+ chi = true;
+ } else if(temp_tile.type <= Tile::Sou_7 && temp_tile.type >= Tile::Sou_1) {
+ chi = true;
}
if(chi) {
temp_action.player = temp_next_player;