From af4da04b968a723710563d7b2355671e82176fad Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 3 Apr 2021 08:57:05 +0300 Subject: [PATCH 43/43] Clean out rscompat code for transforming Irrigate/Mine activities Conversion from transforming Irrigate and Mine activities to Cultivate and Plant is 3.0 to 3.1 change. Master supports conversion from 3.1 to 3.2 only. See osdn #41908 Signed-off-by: Marko Lindqvist --- server/ruleset.c | 65 +++++++++++------------------------------------- 1 file changed, 14 insertions(+), 51 deletions(-) diff --git a/server/ruleset.c b/server/ruleset.c index 5b04bb7568..2b155918de 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -3210,19 +3210,11 @@ static bool load_ruleset_terrain(struct section_file *file, if (!lookup_terrain(file, "cultivate_result", filename, pterrain, &pterrain->cultivate_result, FALSE)) { - if (compat->compat_mode) { - if (!lookup_terrain(file, "irrigation_result", filename, pterrain, - &pterrain->cultivate_result, TRUE)) { - ok = FALSE; - break; - } - } else { - ruleset_error(LOG_ERROR, "%s: No cultivate_result", tsection); - ok = FALSE; - break; - } + ruleset_error(LOG_ERROR, "%s: No cultivate_result", tsection); + ok = FALSE; + break; } - if (!compat->compat_mode && pterrain->cultivate_result == pterrain) { + if (pterrain->cultivate_result == pterrain) { ruleset_error(LOG_ERROR, "%s: Cultivating result in terrain itself.", tsection); ok = FALSE; @@ -3239,19 +3231,11 @@ static bool load_ruleset_terrain(struct section_file *file, if (!lookup_terrain(file, "plant_result", filename, pterrain, &pterrain->plant_result, FALSE)) { - if (compat->compat_mode) { - if (!lookup_terrain(file, "mining_result", filename, pterrain, - &pterrain->plant_result, TRUE)) { - ok = FALSE; - break; - } - } else { - ruleset_error(LOG_ERROR, "%s: No plant_result", tsection); - ok = FALSE; - break; - } + ruleset_error(LOG_ERROR, "%s: No plant_result", tsection); + ok = FALSE; + break; } - if (!compat->compat_mode && pterrain->plant_result == pterrain) { + if (pterrain->plant_result == pterrain) { ruleset_error(LOG_ERROR, "%s: Planting result in terrain itself.", tsection); ok = FALSE; @@ -3268,37 +3252,16 @@ static bool load_ruleset_terrain(struct section_file *file, if (!lookup_time(file, &pterrain->cultivate_time, tsection, "cultivate_time", filename, NULL, &ok)) { - if (compat->compat_mode) { - if (pterrain->cultivate_result != pterrain) { - pterrain->cultivate_time = pterrain->irrigation_time; - pterrain->irrigation_time = 0; - } else { - pterrain->cultivate_time = 0; - pterrain->cultivate_result = NULL; - } - } else { - ruleset_error(LOG_ERROR, "%s: Missing cultivate_time", tsection); - ok = FALSE; - break; - } + ruleset_error(LOG_ERROR, "%s: Missing cultivate_time", tsection); + ok = FALSE; + break; } if (!lookup_time(file, &pterrain->plant_time, tsection, "plant_time", filename, NULL, &ok)) { - if (compat->compat_mode) { - if (pterrain->plant_result != pterrain) { - pterrain->plant_time = pterrain->mining_time; - pterrain->mining_time = 0; - } else { - pterrain->plant_time = 0; - pterrain->plant_result = NULL; - } - } else { - ruleset_error(LOG_ERROR, "%s: Missing plant_time", tsection); - ok = FALSE; - break; - } - + ruleset_error(LOG_ERROR, "%s: Missing plant_time", tsection); + ok = FALSE; + break; } if (!lookup_unit_type(file, tsection, "animal", -- 2.30.2