44#define enough_new_user_flags(_new_flags_, _name_, \
45 _LAST_USER_FLAG_, _LAST_USER_FLAG_PREV_) \
46FC_STATIC_ASSERT((ARRAY_SIZE(_new_flags_) \
47 <= _LAST_USER_FLAG_ - _LAST_USER_FLAG_PREV_), \
48 not_enough_new_##_name_##_user_flags)
50#define UTYF_LAST_USER_FLAG_3_2 UTYF_USER_FLAG_50
59 memset(info, 0,
sizeof(*info));
75 log_fatal(
"\"%s\": ruleset capability problem:", filename);
94 log_fatal(
"\"%s\": ruleset datafile appears incompatible:", filename);
102 log_fatal(
"\"%s\": ruleset datafile claims required option(s)"
103 " that we don't support:", filename);
113 log_error(
"\"%s\": lacking legal format_version field", filename);
117 }
else if (format == 0) {
118 log_error(
"\"%s\": Illegal format_version value", filename);
132 const char *filename,
146 log_fatal(
"\"%s\": ruleset datafile format version differs from"
147 " other ruleset datafile(s):", filename);
180 if (
problem->num_suggested_solutions == 0) {
183 log_error(
"While adding hard obligatory reqs to action enabler"
185 " Don't know how to fix it."
188 ae->ruledit_disabled =
TRUE;
199 for (
i = 0;
i <
problem->num_suggested_solutions;
i++) {
218 log_warn(
"While adding hard obligatory reqs to action enabler"
222 ae->ruledit_disabled =
TRUE;
228 for (
i = 0;
i <
problem->num_suggested_solutions;
i++) {
240 log_error(
"While adding hard obligatory reqs to action enabler"
242 "Failed to apply solution %s."
253 if (
problem->num_suggested_solutions - 1 ==
i) {
288 log_normal(
"action enablers: adding obligatory hard requirements.");
289 log_warn(
"More than one way to fulfill a new obligatory hard requirement"
291 " In that case the enabler is copied so each alternative"
292 " solution is applied to a copy of the enabler."
293 " If an action enabler becomes self contradicting after applying"
294 " a solution it is dropped."
295 " Note that other copies of the original enabler may have"
296 " survived even if one copy is dropped.");
314 if (
ae->ruledit_disabled) {
355 {
N_(
"NoVeteran"),
N_(
"May acquire veteran status.") },
356 {
N_(
"CanEscape"),
N_(
"Can try to escape stack death.") }
369 "Can't upgrade the ruleset. Not enough free unit type "
370 "user flags to add user flags for the unit type flags "
371 "that used to be hardcoded.");
379 "Ruleset had illegal user unit type flag '%s'",
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
const char * action_enabler_vector_by_number_name(req_vec_num_in_item vec)
const char * action_rule_name(const struct action *action)
void action_enabler_add(struct action_enabler *enabler)
struct action_enabler * action_enabler_new(void)
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
struct action_enabler_list * action_enablers_for_action(action_id action)
struct requirement_vector * action_enabler_vector_by_number(const void *enabler, req_vec_num_in_item number)
#define enabler_get_action(_enabler_)
static struct action * action_by_number(action_id act_id)
#define action_has_result(_act_, _res_)
#define action_enabler_list_iterate_end
#define action_iterate_end
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_iterate(_act_)
bool has_capabilities(const char *us, const char *them)
bool iterate_effect_cache(iec_cb cb, void *data)
struct effect * effect_new(enum effect_type type, int value, struct multiplier *pmul)
#define log_warn(message,...)
#define fc_assert_ret_val(condition, val)
#define log_fatal(message,...)
#define log_normal(message,...)
#define log_error(message,...)
const char * secfile_error(void)
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
bool req_vec_change_apply(const struct req_vec_change *modification, requirement_vector_by_number getter, const void *parent_item)
const char * req_vec_change_translation(const struct req_vec_change *change, const requirement_vector_namer namer)
struct requirement req_from_str(const char *type, const char *range, bool survives, bool present, bool quiet, const char *value)
void req_vec_problem_free(struct req_vec_problem *issue)
#define UTYF_LAST_USER_FLAG_3_2
static bool rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae)
bool rscompat_names(struct rscompat_info *info)
void rscompat_postprocess(struct rscompat_info *info)
const char * rscompat_utype_flag_name_3_3(const char *old_name)
int rscompat_check_capabilities(struct section_file *file, const char *filename, const struct rscompat_info *info)
void rscompat_enablers_add_obligatory_hard_reqs(void)
static bool effect_list_compat_cb(struct effect *peffect, void *data)
static int first_free_unit_type_user_flag(void)
void rscompat_init_info(struct rscompat_info *info)
bool rscompat_check_cap_and_version(struct section_file *file, const char *filename, const struct rscompat_info *info)
#define enough_new_user_flags(_new_flags_, _name_, _LAST_USER_FLAG_, _LAST_USER_FLAG_PREV_)
#define RULESET_COMPAT_CAP
#define ruleset_error(logger, level, format,...)
#define RULESET_CAPABILITIES
int fc_strcasecmp(const char *str0, const char *str1)
bool utype_has_role(const struct unit_type *punittype, int role)
const char * unit_type_flag_id_name_cb(enum unit_type_flag_id flag)
void set_user_unit_type_flag_name(enum unit_type_flag_id id, const char *name, const char *helptxt)
#define MAX_NUM_USER_UNIT_FLAGS
#define UTYF_LAST_USER_FLAG
#define unit_type_iterate(_p)
#define unit_type_iterate_end