From cafc22e2fa4c539e802132717f80716b757eb44a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 14 Nov 2021 15:59:46 +0200 Subject: [PATCH 36/36] Rulesave: Save comment about civstyle airlift_[from|to]_always_enabled See osdn #43218 Signed-off-by: Marko Lindqvist --- data/ruledit/comments-3.2.txt | 5 +++++ tools/ruleutil/comments.c | 12 ++++++++++++ tools/ruleutil/comments.h | 1 + tools/ruleutil/rulesave.c | 4 ++++ 4 files changed, 22 insertions(+) diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index 2c4e2fb954..29e9df82b1 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -1249,6 +1249,11 @@ gold_upkeep_style = "\n\ ; upkeep are disbanded.\ " +airlift_always_enabled = "\n\ +; Is it possible to airlift even with zero airlift capacity when\n\ +; airliftingstyle server setting has been set to unlimited airlifts?\ +" + wv_small_wonders = "\ ; When do opponents know which city, if any, has built the Small Wonder\n\ ; \"Always\" - Information is always sent\n\ diff --git a/tools/ruleutil/comments.c b/tools/ruleutil/comments.c index 1b48f8fc6f..5abeae6a54 100644 --- a/tools/ruleutil/comments.c +++ b/tools/ruleutil/comments.c @@ -59,6 +59,7 @@ static struct { char *civstyle_ransom_gold; char *civstyle_gameloss_style; char *civstyle_gold_upkeep_style; + char *civstyle_airlift_always; char *wonder_visibility_small_wonders; char *incite_cost; char *combat_rules_tired_attack; @@ -164,6 +165,8 @@ bool comments_load(void) "entrydoc.gameloss_style"); comment_load(comments_storage.civstyle_gold_upkeep_style, comment_file, "entrydoc.gold_upkeep_style"); + comment_load(comments_storage.civstyle_airlift_always, comment_file, + "entrydoc.airlift_always_enabled"); comment_load(comments_storage.wonder_visibility_small_wonders, comment_file, "entrydoc.wv_small_wonders"); comment_load(comments_storage.incite_cost, comment_file, @@ -504,6 +507,15 @@ void comment_civstyle_gold_upkeep_style(struct section_file *sfile) "civstyle"); } +/**********************************************************************//** + Write civstyle airlift always enabled settings header. +**************************************************************************/ +void comment_civstyle_airlift_always(struct section_file *sfile) +{ + comment_entry_write(sfile, comments_storage.civstyle_airlift_always, + "civstyle"); +} + /**********************************************************************//** Write wonder_visibility small_wonders settings header. **************************************************************************/ diff --git a/tools/ruleutil/comments.h b/tools/ruleutil/comments.h index c571be3d8d..4435c8fe1e 100644 --- a/tools/ruleutil/comments.h +++ b/tools/ruleutil/comments.h @@ -62,6 +62,7 @@ void comment_civstyle_granary(struct section_file *sfile); void comment_civstyle_ransom_gold(struct section_file *sfile); void comment_civstyle_gameloss_style(struct section_file *sfile); void comment_civstyle_gold_upkeep_style(struct section_file *sfile); +void comment_civstyle_airlift_always(struct section_file *sfile); void comment_wonder_visibility_small_wonders(struct section_file *sfile); void comment_incite_cost(struct section_file *sfile); void comment_combat_rules_tired_attack(struct section_file *sfile); diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 41db10cc89..d4dc84a370 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1224,6 +1224,10 @@ static bool save_game_ruleset(const char *filename, const char *name) } save_default_int(sfile, game.info.granularity, 1, "civstyle.output_granularity", NULL); + + if (game.info.airlift_from_always_enabled || !game.info.airlift_to_always_enabled) { + comment_civstyle_airlift_always(sfile); + } save_default_bool(sfile, game.info.airlift_from_always_enabled, FALSE, "civstyle.airlift_from_always_enabled", NULL); save_default_bool(sfile, game.info.airlift_to_always_enabled, -- 2.33.0