diff --git a/host/Host.cpp b/host/Host.cpp index 4a68548f..ac2aba35 100644 --- a/host/Host.cpp +++ b/host/Host.cpp @@ -2234,17 +2234,18 @@ bool Host::createModem() /// bool Host::createNetwork() { + yaml::Node networkConf = m_conf["network"]; + bool netEnable = networkConf["enable"].as(false); + bool rconEnable = networkConf["rconEnable"].as(false); + // dump out if both networking and RCON are disabled - if (m_conf["network"]["enable"].as(false) && m_conf["network"]["rconEnable"].as(false)) { + if (!netEnable && !rconEnable) { return true; } - yaml::Node networkConf = m_conf["network"]; - bool netEnable = networkConf["enable"].as(false); std::string address = networkConf["address"].as(); uint16_t port = (uint16_t)networkConf["port"].as(TRAFFIC_DEFAULT_PORT); uint16_t local = (uint16_t)networkConf["local"].as(0U); - bool rconEnable = networkConf["rconEnable"].as(false); std::string rconAddress = networkConf["rconAddress"].as("127.0.0.1"); uint16_t rconPort = (uint16_t)networkConf["rconPort"].as(RCON_DEFAULT_PORT); std::string rconPassword = networkConf["rconPassword"].as();