Lobby Data: removed unused era_short field

This commit is contained in:
Charles Dang 2018-06-25 18:04:10 +11:00
parent e643d2dce7
commit 619ceabb9d
2 changed files with 0 additions and 31 deletions

View file

@ -162,29 +162,6 @@ const std::string& spaced_em_dash()
return res;
}
// Returns an abbreviated form of the provided string - ie, 'Ageless Era' should become 'AE'
std::string make_short_name(const std::string& long_name)
{
if(long_name.empty()) {
return "";
}
std::size_t pos = 0;
std::stringstream ss;
ss << long_name[pos];
while(pos < long_name.size()) {
pos = long_name.find(' ', pos + 1);
if(pos <= long_name.size() - 2) {
ss << long_name[pos + 1];
}
}
return ss.str();
}
std::string make_game_type_marker(const std::string& text, bool color_for_missing)
{
if(color_for_missing) {
@ -205,7 +182,6 @@ game_info::game_info(const config& game, const std::vector<std::string>& install
, map_info()
, map_size_info()
, era()
, era_short()
, gold(game["mp_village_gold"])
, support(game["mp_village_support"])
, xp(game["experience_modifier"].str() + "%")
@ -263,10 +239,6 @@ game_info::game_info(const config& game, const std::vector<std::string>& install
const bool require = game["require_era"].to_bool(true);
if(era_cfg) {
era = era_cfg["name"].str();
era_short = era_cfg["short_name"].str();
if(era_short.empty()) {
era_short = make_short_name(era);
}
if(require) {
ADDON_REQ result = check_addon_version_compatibility(era_cfg, game);
@ -275,7 +247,6 @@ game_info::game_info(const config& game, const std::vector<std::string>& install
} else {
have_era = !require;
era = game["mp_era_name"].str();
era_short = make_short_name(era);
verified = false;
if(!have_era) {
@ -284,7 +255,6 @@ game_info::game_info(const config& game, const std::vector<std::string>& install
}
} else {
era = _("Unknown era");
era_short = "??";
verified = false;
}

View file

@ -150,7 +150,6 @@ struct game_info
std::string map_info;
std::string map_size_info;
std::string era;
std::string era_short;
/** List of modification names and whether they're installed or not. */
std::vector<std::pair<std::string, bool>> mod_info;