Skip to content

Commit

Permalink
simplify wesnothd::game::change_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Nov 18, 2014
1 parent fa54d65 commit 009403a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/server/game.cpp
Expand Up @@ -558,13 +558,8 @@ void game::change_controller(const size_t side_index,

send_data(response, sock);
if (started_) { //this is added instead of the if (started_) {...} below
simple_wml::document *record = new simple_wml::document;
simple_wml::node& recchg = record->root().add_child("change_controller");
recchg.set_attr_dup("side", side.c_str());
recchg.set_attr_dup("player", player_name.c_str());
recchg.set_attr_dup("controller", (side_controllers_[side_index] == "ai" ? "network_ai" : "network"));

record_data(record); //the purpose of these records is so that observers, replay viewers, get controller updates correctly
//the purpose of these records is so that observers, replay viewers, get controller updates correctly
record_data(response.clone());
}

// Tell the new player that he controls this side now.
Expand Down

0 comments on commit 009403a

Please sign in to comment.