From e2f525ae07d76104dfbbc8f3d7fdc8cda9d5b6c6 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 12 Oct 2023 22:25:38 +0300 Subject: [PATCH 30/30] Correct filling of territory claiming extras cache See osdn #48838 Signed-off-by: Marko Lindqvist --- client/packhand.c | 10 ++++++---- server/ruleset.c | 7 ++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/client/packhand.c b/client/packhand.c index 44589395f9..6f072a9913 100644 --- a/client/packhand.c +++ b/client/packhand.c @@ -4276,10 +4276,7 @@ void handle_ruleset_extra(const struct packet_ruleset_extra *p) if (extra_has_flag(pextra, EF_NOT_AGGRESSIVE)) { extra_to_caused_by_list(pextra, EC_NOT_AGGRESSIVE); } - if (is_extra_caused_by(pextra, EC_BASE) - && territory_claiming_base(extra_base_get(pextra))) { - extra_type_list_append(extra_type_list_of_terr_claimers(), pextra); - } + pextra->hidden_by = p->hidden_by; pextra->bridged_over = p->bridged_over; pextra->conflicts = p->conflicts; @@ -4329,6 +4326,11 @@ void handle_ruleset_base(const struct packet_ruleset_base *p) pbase->vision_main_sq = p->vision_main_sq; pbase->vision_invis_sq = p->vision_invis_sq; pbase->vision_subs_sq = p->vision_subs_sq; + + if (territory_claiming_base(pbase)) { + extra_type_list_append(extra_type_list_of_terr_claimers(), + base_extra_get(pbase)); + } } /************************************************************************//** diff --git a/server/ruleset.c b/server/ruleset.c index 76272c8f35..a29d8371b0 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -3836,11 +3836,6 @@ static bool load_ruleset_terrain(struct section_file *file, extra_to_caused_by_list(pextra, EC_NOT_AGGRESSIVE); } - if (is_extra_caused_by(pextra, EC_BASE) - && territory_claiming_base(extra_base_get(pextra))) { - extra_type_list_append(extra_type_list_of_terr_claimers(), pextra); - } - if (!ok) { break; } @@ -4090,6 +4085,8 @@ static bool load_ruleset_terrain(struct section_file *file, } if (territory_claiming_base(pbase)) { + extra_type_list_append(extra_type_list_of_terr_claimers(), pextra); + extra_type_by_cause_iterate(EC_BASE, pextra2) { struct base_type *pbase2; -- 2.42.0