Fix existing code that was relying on implicit string conversion.

This commit is contained in:
Pentarctagon 2022-01-28 23:50:00 -06:00 committed by Pentarctagon
parent ff3e823960
commit f4e4bf6b49
2 changed files with 3 additions and 3 deletions

View file

@ -232,7 +232,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
throw ingame_wesnothd_error("");
}
auto ctrl = side_controller::get_enum(side_drop_c["controller"]);
auto ctrl = side_controller::get_enum(side_drop_c["controller"].str());
if(!ctrl) {
ERR_NW << "unknown controller type issued from server on side drop: " << side_drop_c["controller"] << std::endl;
throw ingame_wesnothd_error("");

View file

@ -595,10 +595,10 @@ void team::change_controller_by_wml(const std::string& new_controller_string)
}
config choice = synced_context::ask_server_choice(controller_server_choice(*new_controller, *this));
if(!side_controller::get_enum(choice["controller"])) {
if(!side_controller::get_enum(choice["controller"].str())) {
WRN_NG << "Received an invalid controller string from the server" << choice["controller"] << std::endl;
} else {
new_controller = side_controller::get_enum(choice["controller"]);
new_controller = side_controller::get_enum(choice["controller"].str());
}
if(!resources::controller->is_replay()) {