From 978f31c1ebaf9f5a11c9bf7be9a7f05056b51c62 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Tue, 9 Mar 2021 00:31:08 +0100 Subject: [PATCH] rscompat: add HutNothing user uclass flag. Mark all unit classes with a hut_behavior of "Nothing" with the user unit class flag "HutNothing". Once the non user unit class flag "Frighten" is introduced this will allow less than one enabler for the hut popping acitons per unit class and get rid of the custom hut_behavior unit class field. See osdn #41716 --- server/rscompat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/rscompat.c b/server/rscompat.c index 832d1964f6..04bbfbe767 100644 --- a/server/rscompat.c +++ b/server/rscompat.c @@ -352,6 +352,7 @@ bool rscompat_names(struct rscompat_info *info) { N_("CanPillage"), N_("Can pillage tile improvements.") }, { N_("CanFortify"), N_("Gets a 50% defensive bonus while" " in cities.") }, + { N_("HutNothing"), N_("Does nothing to huts.") }, }; enough_new_user_flags(new_class_flags_31, unit_class, UCF_LAST_USER_FLAG, UCF_LAST_USER_FLAG_3_0); @@ -1273,6 +1274,17 @@ void rscompat_postprocess(struct rscompat_info *info) } action_iterate_end; } + if (info->ver_units < 20) { + enum unit_class_flag_id nothing + = unit_class_flag_id_by_name("HutNothing", fc_strcasecmp); + + unit_class_iterate(uc) { + if (uc->hut_behavior == HUT_NOTHING) { + BV_SET(uc->flags, nothing); + } + } unit_class_iterate_end; + } + /* The ruleset may need adjustments it didn't need before compatibility * post processing. * -- 2.20.1