Fixed RCA AI not loading for scenarios with a custom [ai] config,

...especially when the RCA AI is still the only choice available to
the user in the dropbox. (Fix for bug #16607.)
This commit is contained in:
Guillaume Melquiond 2010-12-25 21:06:27 +00:00
parent 07ccfc6be4
commit 429c65fdbc

View File

@ -170,10 +170,10 @@ connect::side::side(connect& parent, const config& cfg, int index) :
update_faction_combo();
if (const config &ai = cfg.child("ai"))
ai_algorithm_ = ai["ai_algorithm"].str();
else if (!parent_->ai_algorithms_.empty())
if (!parent_->ai_algorithms_.empty())
ai_algorithm_ = parent_->ai_algorithms_[0]->id;
else if (const config &ai = cfg.child("ai"))
ai_algorithm_ = ai["ai_algorithm"].str();
else
ai_algorithm_ = "default";
init_ai_algorithm_combo();