From 14c9ed4c5dc155c0a244278f34eec3730c840a68 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Mon, 27 Feb 2017 10:56:45 +1100 Subject: [PATCH] Connect Engine: fixup 95b2d8c4e Turns out the proper value for type= in the case of an Empty controller is "null". Will need to change this since arbitrary string flags like this are absurd and make the code more complicated. --- src/game_initialization/connect_engine.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/game_initialization/connect_engine.cpp b/src/game_initialization/connect_engine.cpp index 342fcad0191d..45c49bca3fc2 100644 --- a/src/game_initialization/connect_engine.cpp +++ b/src/game_initialization/connect_engine.cpp @@ -1085,12 +1085,14 @@ config side_engine::new_config() const } } - // NOTE: the presence of a type= key overrides no_leader. no_leader can be set by the - // controller being set to CNTR_EMPTY, but to be safe we check the key specifically - // here in case it was somehow included in the side config. - if(!(*leader)["no_leader"].to_bool(false)) { + // NOTE: the presence of a type= key overrides no_leader + if(controller_ != CNTR_EMPTY) { (*leader)["type"] = flg_.current_leader(); (*leader)["gender"] = flg_.current_gender(); + } else { + // TODO: FIX THIS SHIT! We shouldn't have a special string to denote no-leader-ness... + (*leader)["type"] = "null"; + (*leader)["gender"] = "null"; } res["team_name"] = parent_.team_names_[team_];