Remove "controller" attribute if it is now longer needed.

In case "controller" was set to some number, we now remove it after it is no
longer needed to avoid locking side to non-existing controller type.

This fixes bug #21964.
This commit is contained in:
Andrius Silinskas 2014-05-10 13:58:21 +01:00
parent 796115114e
commit df5598f29d
2 changed files with 6 additions and 0 deletions

View file

@ -16,6 +16,8 @@ Version 1.11.13+dev:
* Micro AIs: a few more fixes of subtle or rarely occurring bugs in Hang Out
MAI and AI helper libraries
* Fix bug #22030: correct index of weapon special disable in attack GUI
* Fix bug #21964: assertion failure when using "controller" attribute with
a number.
Version 1.11.13:
* AI:

View file

@ -859,6 +859,10 @@ side_engine::side_engine(const config& cfg, connect_engine& parent_engine,
const int side_cntr = cfg_["controller"].to_int(-1);
if (side_cntr != -1) {
current_player_ = lexical_cast<std::string>(side_cntr);
// Remove this attribute to avoid locking side
// to non-existing controller type.
cfg_.remove_attribute("controller");
}
update_controller_options();