Simplify conditions used to fire 'side turn' events.

This commit is contained in:
Dominic Bolin 2006-07-30 15:54:11 +00:00
parent 1ad675a0d4
commit 6bc2d35551

View File

@ -297,9 +297,8 @@ void play_controller::init_side(const unsigned int team_index, bool is_replay){
gamestate_.set_variable("side_number",player_number_str.str());
if(first_turn_) {
int this_team = (gui_->viewing_team() + 1) % teams_.size();
if(this_team == team_index && !team_manager_.is_observer()) {
if (!is_replay){
if(!current_team.is_network()) {
if(!is_replay) {
recorder.add_event("turn 1");
recorder.add_event("new turn");
recorder.add_event("side turn");
@ -307,19 +306,13 @@ void play_controller::init_side(const unsigned int team_index, bool is_replay){
game_events::fire("turn 1");
game_events::fire("new turn");
game_events::fire("side turn");
} else if(current_team.is_ai()) {
game_events::fire("turn 1");
game_events::fire("new turn");
game_events::fire("side turn");
}
first_turn_ = false;
} else
//fire side turn event only if real side change occurs not counting changes from void to a side
if (team_index != (first_player_ - 1) || status_.turn() > start_turn_) {
int this_team = (gui_->viewing_team() + 1) % teams_.size();
if(this_team == team_index && !team_manager_.is_observer()
|| current_team.is_ai()){
if (!is_replay){
if(!current_team.is_network()) {
if(!is_replay) {
recorder.add_event("side turn");
}
game_events::fire("side turn");