summaryrefslogtreecommitdiff
path: root/server/game.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-11-25 01:33:42 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-11-25 01:34:46 +0100
commita265fcaf73543d028b44a10fbbca2b18979f3845 (patch)
tree45cabd7e0ebf7318c42197b7e6207917d115251f /server/game.cpp
parent66940596378b502cf76ad96a5b5a1afb88378454 (diff)
Check for valid action.
Diffstat (limited to 'server/game.cpp')
-rw-r--r--server/game.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/game.cpp b/server/game.cpp
index d13235b..4d102a7 100644
--- a/server/game.cpp
+++ b/server/game.cpp
@@ -67,26 +67,26 @@ void Game::round_update() {
// Only implemented discard so far, so only current player that needs to be able to do a action.
int smart = 0;
for(Actions::iterator it = gamestate.possible_actions.begin(); it != gamestate.possible_actions.end(); ++it) {
- smart = smart | (1 << it->player);
+ //smart = smart | (1 << it->player);
}
int num_player_actions = 0;
if(smart & 1) {
num_player_actions++;
- players[0]->get_action(boost::bind(&Game::handle_action, shared_from_this(), _1));
+ players[0]->get_action(boost::bind(&Game::handle_action, shared_from_this(), _1), gamestate.possible_actions);
}
if(smart & 2) {
num_player_actions++;
- players[1]->get_action(boost::bind(&Game::handle_action, shared_from_this(), _1));
+ players[1]->get_action(boost::bind(&Game::handle_action, shared_from_this(), _1), gamestate.possible_actions);
}
if(smart & 4) {
num_player_actions++;
- players[2]->get_action(boost::bind(&Game::handle_action, shared_from_this(), _1));
+ players[2]->get_action(boost::bind(&Game::handle_action, shared_from_this(), _1), gamestate.possible_actions);
}
if(smart & 8) {
num_player_actions++;
- players[3]->get_action(boost::bind(&Game::handle_action, shared_from_this(), _1));
+ players[3]->get_action(boost::bind(&Game::handle_action, shared_from_this(), _1), gamestate.possible_actions);
}
if(num_player_actions == 0) {