Project

General

Profile

Feature #601 » 0006-Rename-requirement-type-UnitFlag-as-UnitTypeFlag.patch

Marko Lindqvist, 06/05/2024 05:13 PM

View differences:

gen_headers/enums/fc_types_enums.def
UCFLAG "UnitClassFlag"
UCLASS "UnitClass"
UNITSTATE "UnitState"
UTFLAG "UnitFlag"
UTFLAG "UnitTypeFlag"
UTYPE "UnitType"
WRAP "Wrap"
end
server/ruleset/rscompat.c
enabler = action_enabler_new();
enabler->action = ACTION_GAIN_VETERANCY;
e_req = req_from_str("UnitFlag", "Local", FALSE, FALSE, FALSE,
e_req = req_from_str("UnitTypeFlag", "Local", FALSE, FALSE, FALSE,
"NoVeteran");
requirement_vector_append(&enabler->actor_reqs, e_req);
action_enabler_add(enabler);
enabler = action_enabler_new();
enabler->action = ACTION_ESCAPE;
e_req = req_from_str("UnitFlag", "Local", FALSE, TRUE, FALSE,
e_req = req_from_str("UnitTypeFlag", "Local", FALSE, TRUE, FALSE,
"CanEscape");
requirement_vector_append(&enabler->actor_reqs, e_req);
action_enabler_add(enabler);
......
return old_name;
}
/**********************************************************************//**
Convert 3.2 universal name to a 3.3 one.
**************************************************************************/
const char *rscompat_universal_name_3_3(const char *old_name)
{
if (!fc_strcasecmp("UnitFlag", old_name)) {
return "UnitTypeFlag";
}
return old_name;
}
server/ruleset/rscompat.h
/* Functions specific to 3.2 -> 3.3 transition */
const char *rscompat_utype_flag_name_3_3(const char *old_name);
const char *rscompat_universal_name_3_3(const char *old_name);
#ifdef __cplusplus
}
server/ruleset/ruleload.c
"'%s.%s%d'.", filename, sec, sub, j);
}
/* TODO: Allow only in compat mode. */
if (TRUE /* compat->compat_mode && compat->version < RSFORMAT_3_3 */) {
type = rscompat_universal_name_3_3(type);
}
req = req_from_str(type, range, survives, present, quiet, name);
if (req.source.kind == universals_n_invalid()) {
ruleset_error(NULL, LOG_ERROR,
(3-3/3)