Skip to content

Commit

Permalink
fix [modify_side] controller=ai for the current side
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Oct 6, 2019
1 parent dfaadd9 commit adbcbd0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/team.cpp
Expand Up @@ -26,6 +26,7 @@
#include "lexical_cast.hpp"
#include "map/map.hpp"
#include "play_controller.hpp"
#include "playsingle_controller.hpp"
#include "preferences/game.hpp"
#include "resources.hpp"
#include "serialization/string_utils.hpp"
Expand Down Expand Up @@ -592,6 +593,12 @@ void team::change_controller_by_wml(const std::string& new_controller_string)
set_local(choice["is_local"].to_bool());
}

if(playsingle_controller* pc = dynamic_cast<playsingle_controller*>(resources::controller)) {
if(pc->current_side() == side() && new_controller != controller()) {
pc->set_player_type_changed();
}
}

change_controller(new_controller);
}

Expand Down

0 comments on commit adbcbd0

Please sign in to comment.