Fixed control change not to set wrong team if we are playing now

This commit is contained in:
Pauli Nieminen 2008-01-23 09:55:41 +00:00
parent 1832d8b37f
commit 43c13b38dd
5 changed files with 14 additions and 2 deletions

View file

@ -9,6 +9,7 @@ Version 1.3.14+svn:
* fixed bug #10777: Cannot cancel a multiplayer password prompt
* fixed bug #10779: Rejoining game causes major problems
* Fixed :control command to work
* Fixed control change not to set wrong team if we are playing now
* damage statistics for the current turn also works for observers now
* skip replay no longer skips the story for players only for observers
(bug #9538)

View file

@ -678,7 +678,9 @@
name = "Paul Smedley (Creeping)"
[/entry]
[entry]
name = "Pauli Nieminen (coren/suokko)"
name = "Pauli Nieminen (suokko)"
email = "paniemin_AT_cc.hut.fi"
comment = "Bug fixing; ussualy targetting MP or WML engine"
[/entry]
[entry]
name = "Petr Sobotka (Pietro)"

View file

@ -1140,6 +1140,11 @@ void game_display::set_team(size_t teamindex, bool observe)
labels().recalculate_labels();
}
const size_t game_display::get_playing_team()
{
return activeTeam_;
}
void game_display::set_playing_team(size_t teamindex)
{
assert(teamindex < teams_.size());

View file

@ -154,6 +154,7 @@ public:
//! set_playing_team sets the team whose turn it currently is
void set_team(size_t team, bool observe=false);
void set_playing_team(size_t team);
const size_t get_playing_team();
const std::vector<team>& get_teams() {return teams_;};
unit_map& get_units() {return units_;};

View file

@ -161,7 +161,10 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
if ( (controller == "human") && (!teams_[index].is_human()) ) {
teams_[index].make_human();
gui_.set_team(index);
if (teams_[gui_.get_playing_team()].is_human())
{
gui_.set_team(index);
}
} else if ( (controller == "network") && (!teams_[index].is_network()) ){
teams_[index].make_network();
} else if ( (controller == "ai") && (!teams_[index].is_ai()) ) {