From 3b42de03cf15e96839b0c55766263bad3fcade6a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 9 May 2021 13:37:03 +0300 Subject: [PATCH 40/40] Rename action_enabler.disabled as action_enabler.ruledit_disabled See osdn #42174 Signed-off-by: Marko Lindqvist --- common/actions.c | 2 +- common/actions.h | 4 ++-- server/rscompat.c | 10 +++++----- server/ruleset.c | 8 ++++---- tools/ruledit/tab_enablers.cpp | 8 ++++---- tools/ruleutil/rulesave.c | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/common/actions.c b/common/actions.c index 0f8a5594be..2da1c7121d 100644 --- a/common/actions.c +++ b/common/actions.c @@ -2396,7 +2396,7 @@ struct action_enabler *action_enabler_new(void) struct action_enabler *enabler; enabler = fc_malloc(sizeof(*enabler)); - enabler->disabled = FALSE; + enabler->ruledit_disabled = FALSE; requirement_vector_init(&enabler->actor_reqs); requirement_vector_init(&enabler->target_reqs); diff --git a/common/actions.h b/common/actions.h index 08c562dc75..6497be12e1 100644 --- a/common/actions.h +++ b/common/actions.h @@ -436,7 +436,7 @@ struct action_enabler /* Only relevant for ruledit and other rulesave users. Indicates that * this action enabler is deleted and shouldn't be saved. */ - bool disabled; + bool ruledit_disabled; }; #define enabler_get_action(_enabler_) action_by_number(_enabler_->action) @@ -450,7 +450,7 @@ struct action_enabler #define action_enabler_list_re_iterate(action_enabler_list, aenabler) \ action_enabler_list_iterate(action_enabler_list, aenabler) { \ - if (!aenabler->disabled) { + if (!aenabler->ruledit_disabled) { #define action_enabler_list_re_iterate_end \ } \ diff --git a/server/rscompat.c b/server/rscompat.c index 04a590bb8c..75f471e7d7 100644 --- a/server/rscompat.c +++ b/server/rscompat.c @@ -149,7 +149,7 @@ rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae) " Don't know how to fix it." " Dropping it.", action_rule_name(paction), problem->description); - ae->disabled = TRUE; + ae->ruledit_disabled = TRUE; req_vec_problem_free(problem); return TRUE; @@ -183,7 +183,7 @@ rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae) " for %s: %s" " Dropping it.", action_rule_name(paction), problem->description); - ae->disabled = TRUE; + ae->ruledit_disabled = TRUE; req_vec_problem_free(problem); return TRUE; } @@ -209,7 +209,7 @@ rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae) req_vec_change_translation( &problem->suggested_solutions[i], action_enabler_vector_by_number_name)); - new_enabler->disabled = TRUE; + new_enabler->ruledit_disabled = TRUE; req_vec_problem_free(problem); return TRUE; } @@ -217,7 +217,7 @@ rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae) if (problem->num_suggested_solutions - 1 == i) { /* The last modification is to the original enabler. */ ae->action = new_enabler->action; - ae->disabled = new_enabler->disabled; + ae->ruledit_disabled = new_enabler->ruledit_disabled; requirement_vector_copy(&ae->actor_reqs, &new_enabler->actor_reqs); requirement_vector_copy(&ae->target_reqs, @@ -264,7 +264,7 @@ void rscompat_enablers_add_obligatory_hard_reqs(void) do { restart_enablers_for_action = FALSE; action_enabler_list_iterate(action_enablers_for_action(act_id), ae) { - if (ae->disabled) { + if (ae->ruledit_disabled) { /* Ignore disabled enablers */ continue; } diff --git a/server/ruleset.c b/server/ruleset.c index 73fda09f4b..19775c0963 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -240,7 +240,7 @@ static int ruleset_purge_unused_enablers(void) /* Make sure that all action enablers are disabled. */ action_enabler_list_iterate(action_enablers_for_action(paction->id), ae) { - ae->disabled = TRUE; + ae->ruledit_disabled = TRUE; purged++; } action_enabler_list_iterate_end; @@ -251,10 +251,10 @@ static int ruleset_purge_unused_enablers(void) /* Impossible requirement vector requirement. */ action_enabler_list_iterate(action_enablers_for_action(paction->id), ae) { - if (!ae->disabled + if (!ae->ruledit_disabled && (!action_enabler_possible_actor(ae) || req_vec_is_impossible_to_fulfill(&ae->target_reqs))) { - ae->disabled = TRUE; + ae->ruledit_disabled = TRUE; purged++; log_normal("Purged unused action enabler for %s", action_rule_name(paction)); @@ -423,7 +423,7 @@ static int ruleset_purge_redundant_reqs_enablers(void) /* Do the purging. */ action_enabler_list_iterate(action_enablers_for_action(paction->id), ae) { - while (!ae->disabled + while (!ae->ruledit_disabled && (purge_redundant_req_vec(&ae->actor_reqs, actor_reqs) || purge_redundant_req_vec(&ae->target_reqs, target_reqs))) { diff --git a/tools/ruledit/tab_enablers.cpp b/tools/ruledit/tab_enablers.cpp index e8d60a814f..f48bbfcd96 100644 --- a/tools/ruledit/tab_enablers.cpp +++ b/tools/ruledit/tab_enablers.cpp @@ -180,7 +180,7 @@ void tab_enabler::refresh() enabler_list->clear(); action_enablers_iterate(enabler) { - if (!enabler->disabled) { + if (!enabler->ruledit_disabled) { char buffer[512]; QListWidgetItem *item; @@ -282,7 +282,7 @@ void tab_enabler::select_enabler() void tab_enabler::delete_now() { if (selected != nullptr) { - selected->disabled = true; + selected->ruledit_disabled = true; refresh(); update_enabler_info(nullptr); @@ -306,9 +306,9 @@ void tab_enabler::add_now() // Try to reuse freed enabler slot action_enablers_iterate(enabler) { - if (enabler->disabled) { + if (enabler->ruledit_disabled) { if (initialize_new_enabler(enabler)) { - enabler->disabled = false; + enabler->ruledit_disabled = false; update_enabler_info(enabler); refresh(); } diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 69e488321e..6a89ec6d26 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1358,7 +1358,7 @@ static bool save_game_ruleset(const char *filename, const char *name) action_enablers_iterate(pae) { char path[512]; - if (pae->disabled) { + if (pae->ruledit_disabled) { continue; } -- 2.30.2