Project

General

Profile

Feature #385 ยป 0054-server-ruleset-Clear-trailing-spaces.patch

Marko Lindqvist, 03/31/2024 10:08 PM

View differences:

server/ruleset/rssanity.c
bool autoadjust_ruleset_data(void)
{
bool ok = TRUE;
extra_type_by_cause_iterate(EC_RESOURCE, pextra) {
extra_type_by_cause_iterate(EC_RESOURCE, pextra2) {
if (pextra != pextra2) {
server/ruleset/ruleload.c
**************************************************************************/
static bool lookup_unit_list(struct section_file *file, const char *prefix,
const char *entry,
struct unit_type **output,
struct unit_type **output,
const char *filename)
{
const char **slist;
......
const char *description)
{
const char *sval;
sval = secfile_lookup_str_default(file, "None", "%s.%s", prefix, entry);
if (strcmp(sval, "None") == 0) {
......
}
} advance_iterate_all_end;
/* Some more consistency checking:
/* Some more consistency checking:
Non-removed techs depending on removed techs is too
broken to fix by default, so die.
*/
......
const int i = utype_index(u);
BV_CLR_ALL(u->roles);
slist = secfile_lookup_str_vec(file, &nval, "%s.roles",
section_name(section_list_get(sec, i)));
for (j = 0; j < nval; j++) {
......
} unit_type_iterate_end;
}
if (ok) {
if (ok) {
/* Some more consistency checking: */
unit_type_iterate(u) {
unit_tech_reqs_iterate(u, padv) {
......
BV_SET(pextra2->conflicts, extra_index(pextra));
}
}
free(slist);
if (!ok) {
......
g->ai.better = NULL;
}
requirement_vector_copy(&g->reqs, reqs);
sz_strlcpy(g->graphic_str,
secfile_lookup_str(file, "%s.graphic", sec_name));
sz_strlcpy(g->graphic_alt,
......
}
requirement_vector_copy(&pmul->reqs, reqs);
pmul->helptext = lookup_strvec(file, sec_name, "helptext");
pmul->helptext = lookup_strvec(file, sec_name, "helptext");
} multipliers_iterate_end;
section_list_destroy(sec);
}
......
**************************************************************************/
static bool is_on_allowed_list(const char *name, const char **list, size_t len)
{
int i;
int i;
for (i = 0; i < len; i++) {
if (!fc_strcasecmp(name, list[i])) {
......
struct requirement_vector *reqs;
const char *sec_name = section_name(section_list_get(sec, i));
sz_strlcpy(city_styles[i].graphic,
sz_strlcpy(city_styles[i].graphic,
secfile_lookup_str(file, "%s.graphic", sec_name));
sz_strlcpy(city_styles[i].graphic_alt,
sz_strlcpy(city_styles[i].graphic_alt,
secfile_lookup_str(file, "%s.graphic_alt", sec_name));
sz_strlcpy(city_styles[i].citizens_graphic,
secfile_lookup_str_default(file, "-",
......
if (ok) {
/* City Parameters */
game.info.celebratesize =
game.info.celebratesize =
secfile_lookup_int_default(file, GAME_DEFAULT_CELEBRATESIZE,
"parameters.celebrate_size_limit");
game.info.add_to_size_limit =
......
secfile_lookup_bool_default(file, GAME_DEFAULT_ANGRYCITIZEN,
"parameters.angry_citizens");
game.info.changable_tax =
game.info.changable_tax =
secfile_lookup_bool_default(file, GAME_DEFAULT_CHANGABLE_TAX, "parameters.changable_tax");
game.info.forced_science =
game.info.forced_science =
secfile_lookup_int_default(file, 0, "parameters.forced_science");
game.info.forced_luxury =
game.info.forced_luxury =
secfile_lookup_int_default(file, 100, "parameters.forced_luxury");
game.info.forced_gold =
game.info.forced_gold =
secfile_lookup_int_default(file, 0, "parameters.forced_gold");
if (game.info.forced_science + game.info.forced_luxury
+ game.info.forced_gold != 100) {
    (1-1/1)