Freeciv-3.2
Loading...
Searching...
No Matches
rscompat.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* ANSI */
19#ifdef HAVE_STRING_H
20#include <string.h>
21#endif
22
23/* utility */
24#include "capability.h"
25#include "log.h"
26#include "registry.h"
27
28/* common */
29#include "actions.h"
30#include "effects.h"
31#include "fc_types.h"
32#include "game.h"
33#include "movement.h"
34#include "requirements.h"
35#include "unittype.h"
36
37/* server */
38#include "rssanity.h"
39#include "ruleset.h"
40#include "settings.h"
41
42#include "rscompat.h"
43
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)
49
50#define UTYF_LAST_USER_FLAG_3_0 UTYF_USER_FLAG_40
51#define UCF_LAST_USER_FLAG_3_0 UCF_USER_FLAG_8
52#define TER_LAST_USER_FLAG_3_0 TER_USER_8
53
54/**********************************************************************/
58{
59 memset(info, 0, sizeof(*info));
60}
61
62/**********************************************************************/
67 const char *filename,
68 const struct rscompat_info *info)
69{
70 const char *datafile_options;
71 bool ok = FALSE;
72 int format;
73
74 if (!(datafile_options = secfile_lookup_str(file, "datafile.options"))) {
75 log_fatal("\"%s\": ruleset capability problem:", filename);
77
78 return 0;
79 }
80
81 if (info->compat_mode) {
82 /* Check alternative capstr first, so that when we do the main capstr check,
83 * we already know that failures there are fatal (error message correct, can return
84 * immediately) */
85
88 ok = TRUE;
89 }
90 }
91
92 if (!ok) {
94 log_fatal("\"%s\": ruleset datafile appears incompatible:", filename);
95 log_fatal(" datafile options: %s", datafile_options);
96 log_fatal(" supported options: %s", RULESET_CAPABILITIES);
97 ruleset_error(NULL, LOG_ERROR, "Capability problem");
98
99 return 0;
100 }
102 log_fatal("\"%s\": ruleset datafile claims required option(s)"
103 " that we don't support:", filename);
104 log_fatal(" datafile options: %s", datafile_options);
105 log_fatal(" supported options: %s", RULESET_CAPABILITIES);
106 ruleset_error(NULL, LOG_ERROR, "Capability problem");
107
108 return 0;
109 }
110 }
111
112 if (!secfile_lookup_int(file, &format, "datafile.format_version")) {
113 log_error("\"%s\": lacking legal format_version field", filename);
115
116 return 0;
117 } else if (format == 0) {
118 log_error("\"%s\": Illegal format_version value", filename);
119 ruleset_error(NULL, LOG_ERROR, "Format version error");
120 }
121
122 return format;
123}
124/**********************************************************************/
132 const char *filename,
133 const struct rscompat_info *info)
134{
135 int format_version;
136
137 fc_assert_ret_val(info->version > 0, FALSE);
138
139 format_version = rscompat_check_capabilities(file, filename, info);
140 if (format_version <= 0) {
141 /* Already logged in rscompat_check_capabilities */
142 return FALSE;
143 }
144
145 if (format_version != info->version) {
146 log_fatal("\"%s\": ruleset datafile format version differs from"
147 " other ruleset datafile(s):", filename);
148 log_fatal(" datafile format version: %d", format_version);
149 log_fatal(" expected format version: %d", info->version);
150 ruleset_error(NULL, LOG_ERROR, "Inconsistent format versions");
151
152 return FALSE;
153 }
154
155 return TRUE;
156}
157
158/**********************************************************************/
165static bool
167{
168 struct req_vec_problem *problem;
169
171 /* Some changes requires starting to process an action's enablers from
172 * the beginning. */
173 bool needs_restart = FALSE;
174
176 /* A hard obligatory requirement is missing. */
177
178 int i;
179
180 if (problem->num_suggested_solutions == 0) {
181 /* Didn't get any suggestions about how to solve this. */
182
183 log_error("While adding hard obligatory reqs to action enabler"
184 " for %s: %s"
185 " Don't know how to fix it."
186 " Dropping it.",
187 action_rule_name(paction), problem->description);
188 ae->ruledit_disabled = TRUE;
189
191 return TRUE;
192 }
193
194 /* Sanity check. */
195 fc_assert_ret_val(problem->num_suggested_solutions > 0,
197
198 /* Only append is supported for upgrade */
199 for (i = 0; i < problem->num_suggested_solutions; i++) {
200 if (problem->suggested_solutions[i].operation != RVCO_APPEND) {
201 /* A problem that isn't caused by missing obligatory hard
202 * requirements has been detected.
203 *
204 * Probably an old requirement that contradicted a hard requirement
205 * that wasn't documented by making it obligatory. In that case all
206 * suggested solutions has been applied to the enabler creating a
207 * new copy for each possible fulfillment of the new obligatory hard
208 * requirement.
209 *
210 * If another copy of the original enabler has survived this isn't
211 * an error. It probably isn't event an indication of a potential
212 * problem.
213 *
214 * If no possible solution survives the enabler was never in use
215 * because the action it self would have blocked it. In that case
216 * this is an error. */
217
218 log_warn("While adding hard obligatory reqs to action enabler"
219 " for %s: %s"
220 " Dropping it.",
221 action_rule_name(paction), problem->description);
222 ae->ruledit_disabled = TRUE;
224 return TRUE;
225 }
226 }
227
228 for (i = 0; i < problem->num_suggested_solutions; i++) {
230
231 /* There can be more than one suggestion to apply. In that case both
232 * are applied to their own copy. The original should therefore be
233 * kept for now. */
235
236 /* Apply the solution. */
237 if (!req_vec_change_apply(&problem->suggested_solutions[i],
239 new_enabler)) {
240 log_error("While adding hard obligatory reqs to action enabler"
241 " for %s: %s"
242 "Failed to apply solution %s."
243 " Dropping it.",
244 action_rule_name(paction), problem->description,
246 &problem->suggested_solutions[i],
248 new_enabler->ruledit_disabled = TRUE;
250 return TRUE;
251 }
252
253 if (problem->num_suggested_solutions - 1 == i) {
254 /* The last modification is to the original enabler. */
255 ae->action = new_enabler->action;
256 ae->ruledit_disabled = new_enabler->ruledit_disabled;
257 requirement_vector_copy(&ae->actor_reqs,
258 &new_enabler->actor_reqs);
259 requirement_vector_copy(&ae->target_reqs,
260 &new_enabler->target_reqs);
262 } else {
263 /* Register the new enabler */
265
266 /* This changes the number of action enablers. */
268 }
269 }
270
272
273 if (needs_restart) {
274 /* May need to apply future upgrades to the copies too. */
275 return TRUE;
276 }
277 }
278
279 return needs_restart;
280}
281
282/**********************************************************************/
287{
288 log_normal("action enablers: adding obligatory hard requirements.");
289 log_warn("More than one way to fulfill a new obligatory hard requirement"
290 " may exist."
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.");
297
298 action_iterate(act_id) {
300
301 do {
304 if (ae->ruledit_disabled) {
305 /* Ignore disabled enablers */
306 continue;
307 }
309 /* Something important, probably the number of action enablers
310 * for this action, changed. Start over again on this action's
311 * enablers. */
313 break;
314 }
318}
319
320/**********************************************************************/
331{
332 /* No errors encountered. */
333 return TRUE;
334}
335
336/**********************************************************************/
339static bool effect_list_compat_cb(struct effect *peffect, void *data)
340{
341 struct rscompat_info *info = (struct rscompat_info *)data;
342
343 if (info->version < RSFORMAT_3_2) {
344 if (peffect->type == EFT_GROWTH_FOOD) {
345 /* Equivalent Shrink_Food effect for each old Growth_Food */
347 } else if (peffect->type == EFT_ACTION_SUCCESS_MOVE_COST) {
349 if (preq->source.kind == VUT_ACTION
350 && preq->source.value.action == action_by_number(ACTION_ATTACK)) {
351 if (preq->present) {
352 /* Specifically for this action type - create a new effect to OR */
354
356 if (nreq->source.kind == VUT_ACTION
357 && nreq->source.value.action == action_by_number(ACTION_ATTACK)) {
358 nreq->source.value.action = action_by_number(ACTION_COLLECT_RANSOM);
359 }
361 } else {
362 /* Specifically prevent with this action type - add a requirement to AND */
364 req_from_str("Action", "Local",
365 FALSE, FALSE, FALSE,
366 "Collect Ransom"));
367 }
368 break;
369 }
371 } else if (peffect->type == EFT_OUTPUT_PENALTY_TILE) {
373 req_from_str("CityStatus", "City",
374 FALSE, FALSE, FALSE,
375 "Celebration"));
376 }
377 }
378
379 /* Go to the next effect. */
380 return TRUE;
381}
382
383/**********************************************************************/
387{
388 if (!info->compat_mode) {
389 /* There isn't anything here that should be done outside of compat
390 * mode. */
391 return;
392 }
393
394 /* Upgrade existing effects. Done before new effects are added to prevent
395 * the new effects from being upgraded by accident. */
397
398 if (info->version < RSFORMAT_3_2) {
399 struct effect *peffect;
400
401 /* Nuke blast radius has moved to the ruleset. */
402 action_iterate(act_id) {
403 const struct action *paction = action_by_number(act_id);
404
408 /* Not relevant. */
409 continue;
410 }
411
413 effect_req_append(peffect, req_from_str("Action", "Local",
414 FALSE, TRUE, FALSE,
417
418 /* That Attack and Bombard can't destroy a city
419 * has moved to the ruleset. */
423 NULL);
424 effect_req_append(peffect, req_from_str("MinSize", "City", FALSE, FALSE,
425 FALSE, "2"));
426
428 /* "Attack" is split to regular attack and "Collect Ransom" */
429 if (ae->action == ACTION_ATTACK) {
431
433
435 }
437 }
438
439 /* Make sure that all action enablers added or modified by the
440 * compatibility post processing fulfills all hard action requirements. */
442
443 /* The ruleset may need adjustments it didn't need before compatibility
444 * post processing.
445 *
446 * If this isn't done a user of ruleset compatibility that ends up using
447 * the rules risks bad rules. A user that saves the ruleset rather than
448 * using it risks an unexpected change on the next load and save. */
450}
451
452/**********************************************************************/
456 const bv_impr_flags flags,
458{
459 if (compat->compat_mode && compat->version < RSFORMAT_3_2) {
460 if (BV_ISSET(flags, IF_GOLD) && IG_SPECIAL == old_genus) {
461 return IG_CONVERT;
462 }
463 }
464
465 return old_genus;
466}
467
468/**********************************************************************/
472 const char *type,
473 const char *old_range)
474{
475 if (compat->compat_mode && compat->version < RSFORMAT_3_2) {
476 /* Requirement types that refer to the target tile and now use the
477 * "Tile" range instead of the "Local" range */
489 }
490 }
491
492 return old_range;
493}
494
495/**********************************************************************/
499 const char **ptype, const char **pname,
500 bool *ppresent, const char *sec_name)
501{
502 char buf[1024];
503
504 if (compat->compat_mode && compat->version < RSFORMAT_3_2) {
505 /* Recreate old "alltemperate" and "singlepole" ServerSetting
506 * requirements with MinLatitude and MaxLatitude. */
508 if (!fc_strcasecmp("alltemperate", *pname)) {
509 /* alltemperate implies no latitudes != 500
510 * !alltemperate implies latitudes 0 to 1000
511 * ~> alltemperate enabled iff no latitude >= 750
512 * (other numbers in [501,1000] would work as well)
513 * (no latitude <= some number in [0, 499] would work as well) */
515 *pname = "750";
516 *ppresent = !(*ppresent);
517
518 if (compat->log_cb != NULL) {
519 /* Inform the user that there are different solutions */
520 fc_snprintf(buf, sizeof(buf),
521 "Replaced 'alltemperate' server setting requirement "
522 "in %s with a MinLatitude requirement. Other "
523 "equivalent requirements are possible; make sure it "
524 "makes sense.", sec_name);
525 compat->log_cb(buf);
526 }
527 } else if (!fc_strcasecmp("singlepole", *pname)) {
528 /* Assume we're updating a sane ruleset, i.e. singlepole reqs only
529 * possible/relevant when alltemperate is already disabled.
530 * singlepole implies no latitudes < 0
531 * !singlepole implies latitudes -1000 to -1 (given !alltemperate)
532 * ~> singlepole enabled iff no latitude <= -500
533 * (other numbers in [-1000,-1] would work as well) */
535 *pname = "-500";
536 *ppresent = !(*ppresent);
537
538 if (compat->log_cb != NULL) {
539 /* Inform the user that there are different solutions */
540 fc_snprintf(buf, sizeof(buf),
541 "Replaced 'singlepole' server setting requirement "
542 "in %s with a MaxLatitude requirement. Other "
543 "equivalent requirements are possible; make sure it "
544 "makes sense.", sec_name);
545 compat->log_cb(buf);
546 }
547 }
548 }
549
550 /* Former Topology values WrapX and WrapY now Wrap values. */
552 && (!fc_strcasecmp("WrapX", *pname)
553 || !fc_strcasecmp("WrapY", *pname))) {
555 }
556 }
557}
558
559/**********************************************************************/
565{
566 int i = 0;
567
569 "CleanAsFallout", NULL);
570
571 return i;
572}
573
574/**********************************************************************/
577const char *rscompat_extra_rmcause_3_2(struct extra_type *pextra,
578 const char *old_name)
579{
580 const char *retname = old_name;
581
582 if (!fc_strcasecmp("CleanPollution", old_name)) {
583 retname = "Clean";
584 }
585
586 if (!fc_strcasecmp("CleanFallout", old_name)) {
587 /* Don't give this flag to extras that have been using
588 * removal time not tied to terrain, so it won't get
589 * overridden by "ActivityTime" effects we also add. */
590 if (pextra->removal_time == 0) {
591 BV_SET(pextra->flags,
592 extra_flag_id_by_name("CleanAsFallout", fc_strcasecmp));
593 }
594 retname = "Clean";
595 }
596
597 return retname;
598}
599
600/**********************************************************************/
604{
605 /* Huts were not allowed on polar regions
606 * (defined as "Frozen" - but that was just workaround we don't want to reproduce) */
607 if (is_extra_caused_by(pextra, EC_HUT)) {
609 req_from_str("MaxLatitude", "Tile",
610 FALSE, TRUE, FALSE,
611 "980"));
613 req_from_str("MinLatitude", "Tile",
614 FALSE, TRUE, FALSE,
615 "-980"));
616 }
617}
618
619/**********************************************************************/
624{
625 /* Replaced by 'northlatitude' and 'southlatitude' */
626 if (!fc_strcasecmp("alltemperate", name)
627 || !fc_strcasecmp("singlepole", name)) {
628 return TRUE;
629 }
630
631 return FALSE;
632}
633
634/**********************************************************************/
638 const char *section, void (*setdef)(struct setting *pset))
639{
640 /* Replace 'alltemperate' and 'singlepole' with appropriate
641 * 'northlatitude' and 'southlatitude' settings */
642 {
645 const char *name;
646 int j;
647
648 for (j = 0; (name = secfile_lookup_str_default(file, NULL,
649 "%s.set%d.name",
650 section, j)); j++) {
651 bool *pval;
652
653 if (!fc_strcasecmp("alltemperate", name)) {
655 } else if (!fc_strcasecmp("singlepole", name)) {
656 pval = &singlepole;
657 } else {
658 /* neither of the settings we care for */
659 continue;
660 }
661
663
664 if (!secfile_lookup_bool(file, pval, "%s.set%d.value", section, j)) {
665 log_error("Can't read value for setting '%s': %s", name,
666 secfile_error());
667 }
668
670 "%s.set%d.lock", section, j)) {
672 }
673 }
674
675 if (has_either) {
676 int north_latitude = alltemperate ? 500 : 1000;
677 int south_latitude = alltemperate ? 500 : (singlepole ? 0 : -1000);
678 struct setting *pset;
679 char reject_msg[256], buf[256];
680
681#define SET_INT_SETTING(name, value, lock) \
682 pset = setting_by_name(name); \
683 fc_assert(pset != NULL && setting_type(pset) == SST_INT); \
684 \
685 if (setting_int_set(pset, value, NULL, reject_msg, \
686 sizeof(reject_msg))) { \
687 log_normal(_("Ruleset: '%s' has been set to %s."), \
688 setting_name(pset), \
689 setting_value_name(pset, TRUE, buf, sizeof(buf))); \
690 } else { \
691 log_error("%s", reject_msg); \
692 } \
693 \
694 setdef(pset); \
695 \
696 if (lock) { \
697 setting_ruleset_lock_set(pset); \
698 log_normal(_("Ruleset: '%s' has been locked by the ruleset."), \
699 setting_name(pset)); \
700 }
701
702 SET_INT_SETTING("northlatitude", north_latitude, locks_either);
703 SET_INT_SETTING("southlatitude", south_latitude, locks_either);
704
705#undef SET_INT_SETTING
706 }
707 }
708}
709
710/**********************************************************************/
714 const char *tsection,
715 struct terrain *pterrain)
716{
717 int pol_time = 3; /* Old default */
718 int fal_time = 3; /* Old default */
719 const char *filename = secfile_name(file);
720 bool ok = TRUE;
721
722 lookup_time(file, &pol_time,
723 tsection, "clean_pollution_time", filename, NULL, &ok);
724 lookup_time(file, &fal_time,
725 tsection, "clean_fallout_time", filename, NULL, &ok);
726
727 if (pol_time == fal_time) {
728 extra_type_iterate(pextra) {
729 pterrain->extra_removal_times[extra_index(pextra)] = pol_time;
731 } else {
732 struct effect *peffect;
733
734 extra_type_iterate(pextra) {
735 pterrain->extra_removal_times[extra_index(pextra)] = pol_time;
737
739 effect_req_append(peffect, req_from_str("ExtraFlag", "Local",
740 FALSE, TRUE, TRUE,
741 "CleanAsFallout"));
742 effect_req_append(peffect, req_from_str("Terrain", "Tile",
743 FALSE, TRUE, TRUE,
744 terrain_rule_name(pterrain)));
745 }
746
747 return ok;
748}
749
750/**********************************************************************/
754 const char *orig)
755{
756 if (compat->compat_mode && compat->version < RSFORMAT_3_2
757 && (!fc_strcasecmp("Clean Pollution", orig)
758 || !fc_strcasecmp("Clean Fallout", orig))) {
759 return "Clean";
760 }
761
762 return orig;
763}
764
765/**********************************************************************/
769 struct action_enabler *enabler,
770 const char *orig_name)
771{
772 if (!fc_strcasecmp("CleanAsFallout", orig_name)) {
774 req_from_str("ExtraFlag", "Local",
775 FALSE, TRUE, TRUE,
776 "CleanAsFallout"));
777 }
778}
779
780/**********************************************************************/
784 int act_id)
785{
786 if (compat->compat_mode && compat->version < RSFORMAT_3_2) {
787 if (act_id == ACTION_TRANSPORT_DEBOARD) {
788 return "ui_name_transport_alight";
789 } else if (act_id == ACTION_ROAD) {
790 return "ui_name_road";
791 }
792 }
793
794 return NULL;
795}
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
Definition actions.c:2679
const char * action_enabler_vector_by_number_name(req_vec_num_in_item vec)
Definition actions.c:2856
const char * action_rule_name(const struct action *action)
Definition actions.c:1977
void action_enabler_add(struct action_enabler *enabler)
Definition actions.c:2282
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
Definition actions.c:2267
struct action_enabler_list * action_enablers_for_action(action_id action)
Definition actions.c:2315
struct requirement_vector * action_enabler_vector_by_number(const void *enabler, req_vec_num_in_item number)
Definition actions.c:2832
#define action_enablers_iterate_end
Definition actions.h:519
#define enabler_get_action(_enabler_)
Definition actions.h:433
static struct action * action_by_number(action_id act_id)
Definition actions.h:635
#define action_has_result(_act_, _res_)
Definition actions.h:431
#define action_enabler_list_iterate_end
Definition actions.h:441
#define action_iterate_end
Definition actions.h:465
#define action_enablers_iterate(_enabler_)
Definition actions.h:513
#define action_enabler_list_iterate(action_enabler_list, aenabler)
Definition actions.h:439
#define action_iterate(_act_)
Definition actions.h:461
#define BV_SET(bv, bit)
Definition bitvector.h:81
#define BV_ISSET(bv, bit)
Definition bitvector.h:78
bool has_capabilities(const char *us, const char *them)
Definition capability.c:86
char * incite_cost
Definition comments.c:75
bool iterate_effect_cache(iec_cb cb, void *data)
Definition effects.c:1323
struct effect * effect_new(enum effect_type type, int value, struct multiplier *pmul)
Definition effects.c:186
struct effect * effect_copy(struct effect *old, enum effect_type override_type)
Definition effects.c:246
void effect_req_append(struct effect *peffect, struct requirement req)
Definition effects.c:266
int effect_value_will_make_positive(enum effect_type type)
Definition effects.c:582
void set_user_extra_flag_name(enum extra_flag_id id, const char *name, const char *helptxt)
Definition extras.c:933
#define extra_type_iterate(_p)
Definition extras.h:315
#define extra_type_iterate_end
Definition extras.h:321
#define is_extra_caused_by(e, c)
Definition extras.h:203
#define extra_index(_e_)
Definition extras.h:183
GType type
Definition repodlgs.c:1313
const char * name
Definition inputfile.c:127
#define log_warn(message,...)
Definition log.h:105
#define fc_assert_ret_val(condition, val)
Definition log.h:194
#define log_fatal(message,...)
Definition log.h:100
#define log_normal(message,...)
Definition log.h:107
@ LOG_ERROR
Definition log.h:30
#define log_error(message,...)
Definition log.h:103
#define FC_FREE(ptr)
Definition mem.h:41
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 secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
const char * secfile_name(const struct section_file *secfile)
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
bool secfile_lookup_bool(const struct section_file *secfile, bool *bval, 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 requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
void rscompat_settings_do_special_handling(struct section_file *file, const char *section, void(*setdef)(struct setting *pset))
Definition rscompat.c:637
const char * rscompat_req_range_3_2(struct rscompat_info *compat, const char *type, const char *old_range)
Definition rscompat.c:471
int add_user_extra_flags_3_2(int start)
Definition rscompat.c:564
#define SET_INT_SETTING(name, value, lock)
const char * rscompat_action_ui_name_3_2(struct rscompat_info *compat, int act_id)
Definition rscompat.c:783
static bool rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae)
Definition rscompat.c:166
bool rscompat_terrain_extra_rmtime_3_2(struct section_file *file, const char *tsection, struct terrain *pterrain)
Definition rscompat.c:713
bool rscompat_names(struct rscompat_info *info)
Definition rscompat.c:330
bool rscompat_setting_needs_special_handling(const char *name)
Definition rscompat.c:623
void rscompat_postprocess(struct rscompat_info *info)
Definition rscompat.c:386
int rscompat_check_capabilities(struct section_file *file, const char *filename, const struct rscompat_info *info)
Definition rscompat.c:66
void rscompat_extra_adjust_3_2(struct extra_type *pextra)
Definition rscompat.c:603
void rscompat_enablers_add_obligatory_hard_reqs(void)
Definition rscompat.c:286
const char * rscompat_action_rule_name_3_2(struct rscompat_info *compat, const char *orig)
Definition rscompat.c:753
void rscompat_req_adjust_3_2(const struct rscompat_info *compat, const char **ptype, const char **pname, bool *ppresent, const char *sec_name)
Definition rscompat.c:498
static bool effect_list_compat_cb(struct effect *peffect, void *data)
Definition rscompat.c:339
enum impr_genus_id rscompat_genus_3_2(struct rscompat_info *compat, const bv_impr_flags flags, enum impr_genus_id old_genus)
Definition rscompat.c:455
void rscompat_action_enabler_adjust_3_2(struct rscompat_info *compat, struct action_enabler *enabler, const char *orig_name)
Definition rscompat.c:768
const char * rscompat_extra_rmcause_3_2(struct extra_type *pextra, const char *old_name)
Definition rscompat.c:577
void rscompat_init_info(struct rscompat_info *info)
Definition rscompat.c:57
bool rscompat_check_cap_and_version(struct section_file *file, const char *filename, const struct rscompat_info *info)
Definition rscompat.c:131
bool lookup_time(const struct section_file *secfile, int *turns, const char *sec_name, const char *property_name, const char *filename, const char *item_name, bool *ok)
Definition ruleset.c:1264
#define RULESET_COMPAT_CAP
Definition rscompat.h:27
bool autoadjust_ruleset_data(void)
Definition rssanity.c:1576
#define ruleset_error(logger, level, format,...)
Definition ruleset.h:57
#define RSFORMAT_3_2
Definition ruleset.h:36
#define RULESET_CAPABILITIES
Definition ruleset.h:24
static struct compatibility compat[]
Definition savecompat.c:105
bv_extra_flags flags
Definition extras.h:132
int removal_time
Definition extras.h:120
struct requirement_vector reqs
Definition extras.h:106
bool compat_mode
Definition rscompat.h:31
int extra_removal_times[MAX_EXTRA_TYPES]
Definition terrain.h:235
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:974
int fc_strcasecmp(const char *str0, const char *str1)
Definition support.c:189
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
const char * terrain_rule_name(const struct terrain *pterrain)
Definition terrain.c:247