fixes bug #6001 (droid command not working)

This commit is contained in:
Jörg Hinrichs 2006-06-01 18:16:19 +00:00
parent fb81fbdaef
commit 4f566b5bb2
2 changed files with 16 additions and 8 deletions

View file

@ -1578,10 +1578,13 @@ namespace events{
const size_t index = static_cast<size_t>(side - 1);
if (index >= teams_.size() || teams_[index].is_network()) {
//do nothing
} else if (teams_[index].is_human()) {
} else if (teams_[index].is_human()) {
//this is our side, so give it to AI
teams_[index].make_ai();
textbox_info_.close(*gui_);
if(team_num == side) {
if(team_num == side) {
//if it is our turn at the moment, we have to indicate to the
//play_controller, that we are no longer in control
throw end_turn_exception(side);
}
} else if (teams_[index].is_ai()) {
@ -1620,14 +1623,19 @@ namespace events{
return;
}
if(side_num > 0 && side_num <= teams_.size()) {
if(teams_[static_cast<size_t>(side_num - 1)].is_human()) {
if(teams_[static_cast<size_t>(side_num - 1)].is_human()) {
//if this is our side we are always allowed to change the controller
change_side_controller(side,player,true);
if(team_num == side_num) {
teams_[static_cast<size_t>(side_num - 1)].make_network();
textbox_info_.close(*gui_);
teams_[static_cast<size_t>(side_num - 1)].make_network();
textbox_info_.close(*gui_);
if(team_num == side_num) {
//if it is our turn at the moment, we have to indicate to the
//play_controller, that we are no longer in control
throw end_turn_exception(side_num);
}
} else {
} else {
//it is not our side, the server will decide if we can change the
//controller (that is if we are host of the game)
change_side_controller(side,player);
}
}

View file

@ -394,7 +394,7 @@ redo_turn:
play_human_turn();
after_human_turn();
} catch(end_turn_exception& end_turn) {
if (end_turn.redo == (team_index + 1U) )
if (end_turn.redo == team_index)
player_type_changed_ = true;
}