From 31e6b5198bdc04c64fb3e389d1482d89a9f9e76b Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Thu, 4 Feb 2021 18:58:03 +0100 Subject: [PATCH] ruleset: remove 2.6 ruleset check. Freeciv 3.1 doesn't support loading 2.6 rulesets, even in compatibility mode. See osdn #41463 --- server/ruleset.c | 62 +++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/server/ruleset.c b/server/ruleset.c index 51c9b10fa1..ff768cda01 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -1112,43 +1112,41 @@ static bool load_game_names(struct section_file *file, section_list_destroy(sec); - if (compat->ver_game >= 10) { - if (ok) { - sec = secfile_sections_by_name_prefix(file, GOODS_SECTION_PREFIX); + if (ok) { + sec = secfile_sections_by_name_prefix(file, GOODS_SECTION_PREFIX); - nval = (NULL != sec ? section_list_size(sec) : 0); - if (nval > MAX_GOODS_TYPES) { - int num = nval; /* No "size_t" to printf */ + nval = (NULL != sec ? section_list_size(sec) : 0); + if (nval > MAX_GOODS_TYPES) { + int num = nval; /* No "size_t" to printf */ - ruleset_error(LOG_ERROR, - "\"%s\": Too many goods types (%d, max %d)", - filename, num, MAX_GOODS_TYPES); - section_list_destroy(sec); - ok = FALSE; - } else if (nval < 1) { - ruleset_error(LOG_ERROR, "\"%s\": At least one goods type needed", - filename); - section_list_destroy(sec); - ok = FALSE; - } else { - game.control.num_goods_types = nval; - } + ruleset_error(LOG_ERROR, + "\"%s\": Too many goods types (%d, max %d)", + filename, num, MAX_GOODS_TYPES); + section_list_destroy(sec); + ok = FALSE; + } else if (nval < 1) { + ruleset_error(LOG_ERROR, "\"%s\": At least one goods type needed", + filename); + section_list_destroy(sec); + ok = FALSE; + } else { + game.control.num_goods_types = nval; + } - if (ok) { - goods_type_iterate(pgood) { - const char *sec_name - = section_name(section_list_get(sec, goods_index(pgood))); + if (ok) { + goods_type_iterate(pgood) { + const char *sec_name + = section_name(section_list_get(sec, goods_index(pgood))); - if (!ruleset_load_names(&pgood->name, NULL, file, sec_name)) { - ruleset_error(LOG_ERROR, "\"%s\": Cannot load goods names", - filename); - ok = FALSE; - break; - } - } goods_type_iterate_end; - } - section_list_destroy(sec); + if (!ruleset_load_names(&pgood->name, NULL, file, sec_name)) { + ruleset_error(LOG_ERROR, "\"%s\": Cannot load goods names", + filename); + ok = FALSE; + break; + } + } goods_type_iterate_end; } + section_list_destroy(sec); } return ok; -- 2.20.1