mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 04:28:47 +00:00
Move 'allow_player_' back to initializer list.
This commit is contained in:
parent
e51aaa626f
commit
8c864cdf72
@ -99,6 +99,7 @@ connect::side::side(connect& parent, const config& cfg, int index) :
|
|||||||
slider_income_(parent.video()),
|
slider_income_(parent.video()),
|
||||||
label_gold_(parent.video(), "100", font::SIZE_SMALL, font::LOBBY_COLOR),
|
label_gold_(parent.video(), "100", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||||
label_income_(parent.video(), _("Normal"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
label_income_(parent.video(), _("Normal"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||||
|
allow_player_(cfg["controller"] == "ai" && cfg["allow_player"].empty() ? false : cfg["allow_player"].to_bool(true)),
|
||||||
allow_changes_(cfg["allow_changes"].to_bool(true)),
|
allow_changes_(cfg["allow_changes"].to_bool(true)),
|
||||||
enabled_(!parent_->params_.saved_game), changed_(false),
|
enabled_(!parent_->params_.saved_game), changed_(false),
|
||||||
llm_(parent.era_sides_, enabled_ ? &combo_leader_ : NULL, enabled_ ? &combo_gender_ : NULL)
|
llm_(parent.era_sides_, enabled_ ? &combo_leader_ : NULL, enabled_ ? &combo_gender_ : NULL)
|
||||||
@ -108,9 +109,6 @@ connect::side::side(connect& parent, const config& cfg, int index) :
|
|||||||
if (cfg_["controller"] == "human_ai"
|
if (cfg_["controller"] == "human_ai"
|
||||||
|| cfg_["controller"] == "network_ai")
|
|| cfg_["controller"] == "network_ai")
|
||||||
cfg_["controller"] = "ai";
|
cfg_["controller"] = "ai";
|
||||||
|
|
||||||
allow_player_ = (cfg_["controller"] == "ai" && cfg_["allow_player"].empty() ? false : cfg_["allow_player"].to_bool(true));
|
|
||||||
|
|
||||||
if(allow_player_ && enabled_) {
|
if(allow_player_ && enabled_) {
|
||||||
controller_ = parent_->default_controller_;
|
controller_ = parent_->default_controller_;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user