143#define ACTIVITY_OLD_ROAD (ACTIVITY_LAST + 1)
144#define ACTIVITY_OLD_RAILROAD (ACTIVITY_LAST + 2)
145#define ACTIVITY_OLD_POLLUTION_SG2 (ACTIVITY_OLD_RAILROAD + 1)
146#define ACTIVITY_OLD_FALLOUT_SG2 (ACTIVITY_OLD_POLLUTION_SG2 + 1)
147#define ACTIVITY_LAST_SAVEGAME2 (ACTIVITY_OLD_FALLOUT_SG2 + 1)
162#define SAVE_MAP_CHAR(ptile, GET_XY_CHAR, secfile, secpath, ...) \
164 char _line[wld.map.xsize + 1]; \
165 int _nat_x, _nat_y; \
167 for (_nat_y = 0; _nat_y < wld.map.ysize; _nat_y++) { \
168 for (_nat_x = 0; _nat_x < wld.map.xsize; _nat_x++) { \
169 struct tile *ptile = native_pos_to_tile(&(wld.map), _nat_x, _nat_y); \
170 fc_assert_action(ptile != NULL, continue); \
171 _line[_nat_x] = (GET_XY_CHAR); \
172 sg_failure_ret(fc_isprint(_line[_nat_x] & 0x7f), \
173 "Trying to write invalid map data at position " \
174 "(%d, %d) for path %s: '%c' (%d)", _nat_x, _nat_y, \
175 secpath, _line[_nat_x], _line[_nat_x]); \
177 _line[wld.map.xsize] = '\0'; \
178 secfile_insert_str(secfile, _line, secpath, ## __VA_ARGS__, _nat_y); \
209#define LOAD_MAP_CHAR(ch, ptile, SET_XY_CHAR, secfile, secpath, ...) \
211 int _nat_x, _nat_y; \
212 bool _printed_warning = FALSE; \
213 for (_nat_y = 0; _nat_y < wld.map.ysize; _nat_y++) { \
214 const char *_line = secfile_lookup_str(secfile, secpath, \
215 ## __VA_ARGS__, _nat_y); \
216 if (NULL == _line) { \
218 fc_snprintf(buf, sizeof(buf), secpath, ## __VA_ARGS__, _nat_y); \
219 log_verbose("Line not found='%s'", buf); \
220 _printed_warning = TRUE; \
222 } else if (strlen(_line) != wld.map.xsize) { \
224 fc_snprintf(buf, sizeof(buf), secpath, ## __VA_ARGS__, _nat_y); \
225 log_verbose("Line too short (expected %d got " SIZE_T_PRINTF \
226 ")='%s'", wld.map.xsize, strlen(_line), buf); \
227 _printed_warning = TRUE; \
230 for (_nat_x = 0; _nat_x < wld.map.xsize; _nat_x++) { \
231 const char ch = _line[_nat_x]; \
232 struct tile *ptile = native_pos_to_tile(&(wld.map), _nat_x, _nat_y); \
236 if (_printed_warning) { \
238 log_sg(_("Saved game contains incomplete map data. This can" \
239 " happen with old saved games, or it may indicate an" \
240 " invalid saved game file. Proceed at your own risk.")); \
245#define halfbyte_iterate_extras(e, num_extras_types) \
248 for (e = 0; 4 * e < (num_extras_types); e++) {
250#define halfbyte_iterate_extras_end \
255#define halfbyte_iterate_special(s, num_specials_types) \
257 enum tile_special_type s; \
258 for (s = 0; 4 * s < (num_specials_types); s++) {
260#define halfbyte_iterate_special_end \
265#define halfbyte_iterate_bases(b, num_bases_types) \
268 for (b = 0; 4 * b < (num_bases_types); b++) {
270#define halfbyte_iterate_bases_end \
275#define halfbyte_iterate_roads(r, num_roads_types) \
278 for (r = 0; 4 * r < (num_roads_types); r++) {
280#define halfbyte_iterate_roads_end \
286#define ORDER_OLD_BUILD_CITY (-1)
287#define ORDER_OLD_DISBAND (-2)
288#define ORDER_OLD_BUILD_WONDER (-3)
289#define ORDER_OLD_TRADE_ROUTE (-4)
290#define ORDER_OLD_HOMECITY (-5)
303 const char *path, ...);
322 const char *path,
int plrno);
478 loading->improvement.size = -1;
726 if (activity ==
achar) {
750 log_error(
_(
"Syntax error in attribute block."));
761 log_error(
_(
"Syntax error in attribute block."));
767 for (
i = 0;
i < length;
i++) {
773 log_error(
_(
"Syntax error in attribute block."));
777 ((
unsigned char *) dest)[
i] =
tmp;
807 for (
i = 0;
i <
pwl->length;
i++) {
861 if (!
pch ||
ch ==
'\0') {
862 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
868 for (
i = 0;
i < 4;
i++) {
871 if (pextra ==
NULL) {
894 if (!
pch ||
ch ==
'\0') {
895 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
901 for (
i = 0;
i < 4;
i++) {
904 if (pextra ==
NULL) {
928 if (!
pch ||
ch ==
'\0') {
929 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
935 for (
i = 0;
i < 4;
i++) {
956 if (
bin & (1 <<
i)) {
1065 if (!
pch ||
ch ==
'\0') {
1066 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1072 for (
i = 0;
i < 4;
i++) {
1093 if (
bin & (1 <<
i)) {
1201 if (!
pch ||
ch ==
'\0') {
1202 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1208 for (
i = 0;
i < 4;
i++) {
1214 if (
bin & (1 <<
i)) {
1232 if (!
pch ||
ch ==
'\0') {
1233 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1239 for (
i = 0;
i < 4;
i++) {
1245 if (
bin & (1 <<
i)) {
1263 if (!
pch ||
ch ==
'\0') {
1264 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1270 for (
i = 0;
i < 4;
i++) {
1276 if (
bin & (1 <<
i)) {
1294 if (!
pch ||
ch ==
'\0') {
1295 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1301 for (
i = 0;
i < 4;
i++) {
1307 if (
bin & (1 <<
i)) {
1338 if (pterrain->identifier ==
ch) {
1343 log_fatal(
"Unknown terrain identifier '%c' in savegame.",
ch);
1355 const char *path,
int plrno)
1398 "savefile.rulesetdir");
1406 if (version >= 30) {
1415 log_verbose(
"Savegame specified ruleset '%s'. Really loading '%s'.",
1452 "savefile.last_updated_as_year");
1457 "savefile.improvement_size");
1458 if (
loading->improvement.size) {
1461 "savefile.improvement_vector");
1463 "Failed to load improvement order: %s",
1470 "savefile.technology_size");
1471 if (
loading->technology.size) {
1474 "savefile.technology_vector");
1476 "Failed to load technology order: %s",
1483 "savefile.activities_size");
1484 if (
loading->activities.size) {
1487 "savefile.activities_vector");
1489 "Failed to load activity order: %s",
1496 "savefile.trait_size");
1500 "savefile.trait_vector");
1502 "Failed to load trait order: %s",
1509 "savefile.extras_size");
1516 "savefile.extras_vector");
1518 "Failed to load extras order: %s",
1521 "Number of extras defined by the ruleset (= %d) are "
1522 "lower than the number in the savefile (= %d).",
1527 for (j = 0; j <
loading->extra.size; j++) {
1531 for (; j <
nmod; j++) {
1539 "savefile.multipliers_size");
1540 if (
loading->multiplier.size) {
1545 "savefile.multipliers_vector");
1547 "Failed to load multipliers order: %s",
1552 sizeof(*
loading->multiplier.order));
1553 for (j = 0; j <
loading->multiplier.size; j++) {
1555 if (!
loading->multiplier.order[j]) {
1556 log_verbose(
"Multiplier \"%s\" in savegame but not in ruleset, "
1566 "savefile.specials_size");
1573 "savefile.specials_vector");
1575 "Failed to load specials order: %s",
1590 sizeof(*
loading->special.order));
1591 for (j = 0; j <
loading->special.size; j++) {
1603 for (; j <
nmod; j++) {
1611 "savefile.bases_size");
1618 "savefile.bases_vector");
1620 "Failed to load bases order: %s",
1625 for (j = 0; j <
loading->base.size; j++) {
1630 "Unknown base type %s in savefile.",
1633 if (pextra !=
NULL) {
1640 for (; j <
nmod; j++) {
1648 "savefile.roads_size");
1655 "savefile.roads_vector");
1657 "Failed to load roads order: %s",
1660 "Number of roads defined by the ruleset (= %d) are "
1661 "lower than the number in the savefile (= %d).",
1666 for (j = 0; j <
loading->road.size; j++) {
1669 if (pextra !=
NULL) {
1676 for (; j <
nmod; j++) {
1684 "savefile.specialists_size");
1685 if (
loading->specialist.size) {
1691 "savefile.specialists_vector");
1693 "Failed to load specialists order: %s",
1696 "Number of specialists defined by the ruleset (= %d) are "
1697 "lower than the number in the savefile (= %d).",
1705 for (j = 0; j <
loading->specialist.size; j++) {
1709 for (; j <
nmod; j++) {
1717 "savefile.diplstate_type_size");
1720 "Failed to load diplomatic state type order: %s",
1728 "savefile.diplstate_type_vector");
1731 sizeof(*
loading->ds_t.order));
1733 for (j = 0; j <
loading->ds_t.size; j++) {
1744 "savefile.city_options_size");
1747 const char *
modname_old[] = {
"Disband",
"Sci_Specialists",
"Tax_Specialists" };
1752 if (
loading->coptions.size > 0) {
1754 "savefile.city_options_vector");
1763 sizeof(*
loading->coptions.order));
1765 for (j = 0; j <
loading->coptions.size; j++) {
1777 pterr->identifier_load =
'\0';
1782 "savefile.terrident%d.name",
i)) !=
NULL) {
1787 "savefile.terrident%d.identifier",
i);
1800 "%s and %s share a saved identifier",
1824 "ruledata.government%d.name",
i));
1830 "ruledata.government%d.changes",
i);
1852 "version 2.2.99 required.");
1860 "game.server_state");
1869 "game.meta_patches");
1878 "game.meta_server"));
1900 "game.phase_mode_stored");
1914 "game.timeoutintinc");
1920 "game.timeoutincmult");
1923 "game.timeoutcounter");
1952 "game.global_advances");
1955 "Invalid length of 'game.global_advances' ("
1958 for (
i = 0;
i <
loading->technology.size;
i++) {
1960 "Undefined value '%c' within 'game.global_advances'.",
1962 if (
str[
i] ==
'1') {
2017 for (
i = 0;
i < 8;
i++) {
2085 if (
buf[0] !=
'\0') {
2090 "scenario.authors");
2091 if (
buf[0] !=
'\0') {
2098 "scenario.description");
2099 if (
buf[0] !=
'\0') {
2111 "scenario.startpos_nations");
2115 "scenario.prevent_new_cities");
2116 if (
loading->version < 20599) {
2127 "scenario.lake_flooding");
2130 "scenario.handmade");
2133 "scenario.allow_ai_type_fallback");
2139 "Invalid scenario definition (server state '%s' and "
2278 const char *spec_sprite;
2287 if (
NULL != ptile->spec_sprite) {
2288 ptile->spec_sprite =
fc_strdup(spec_sprite);
2290 if (label !=
NULL) {
2308 loading->file,
"map.e%02d_%04d", j);
2324 loading->file,
"map.b%02d_%04d", j);
2340 loading->file,
"map.r%02d_%04d", j);
2369 loading->special.order + 4 * j,
2371 loading->file,
"map.spe%02d_%04d", j);
2384 loading->file,
"map.res%04d");
2388 if (
NULL == ptile->resource) {
2430 "map.startpos%d.y",
i)) {
2431 log_sg(
"Warning: Undefined coordinates for startpos %d",
i);
2436 if (
NULL == ptile) {
2437 log_error(
"Start position native coordinates (%d, %d) do not exist "
2443 "map.startpos%d.exclude",
i);
2448 "map.startpos%d.nations",
i);
2454 for (start =
buf - 1;
NULL != start; start = end) {
2477 log_verbose(
"Number of starts (%d) are lower than rules.max_players "
2478 "(%d), lowering rules.max_players.",
2510 "map.owner%04d",
y);
2512 "map.source%04d",
y);
2514 "map.eowner%04d",
y);
2534 "Map size not correct (map.owner%d).",
y);
2539 "Got map owner %s in (%d, %d).",
token1,
x,
y);
2545 "Map size not correct (map.source%d).",
y);
2550 "Got map source %s in (%d, %d).",
token2,
x,
y);
2557 "Map size not correct (map.eowner%d).",
y);
2562 "Got base owner %s in (%d, %d).",
token3,
x,
y);
2587 "City worked map not loaded!");
2590 sizeof(*
loading->worked_tiles));
2595 const char *ptr = buffer;
2598 "Savegame corrupt - map line %d not found.",
y);
2604 scanin(&ptr,
",", token,
sizeof(token));
2606 "Savegame corrupt - map size not correct.");
2607 if (
strcmp(token,
"-") == 0) {
2611 "Savegame corrupt - got tile worked by city "
2612 "id=%s in (%d, %d).", token,
x,
y);
2635 "game.save_known")) {
2640 for (j = 0; j < 8; j++) {
2641 for (
i = 0;
i < 4;
i++) {
2648 loading->file,
"map.k%02d_%04d",
l * 8 + j);
2704 "players.destroyed_wonders");
2707 "Invalid length for 'players.destroyed_wonders' ("
2710 for (k = 0; k <
loading->improvement.size; k++) {
2712 "Undefined value '%c' within "
2713 "'players.destroyed_wonders'.",
str[k]);
2715 if (
str[k] ==
'1') {
2728 "players.identity_number_used");
2757 log_sg(
"Game has started, yet player %d has no color defined.",
2789 for (k = 0; k <
loading->multiplier.size; k++) {
2796 "player%d.multiplier%d.val",
2802 log_verbose(
"Player %d had illegal value for multiplier \"%s\": "
2811 "player%d.multiplier%d.target",
2817 log_verbose(
"Player %d had illegal value for multiplier_target "
2818 "\"%s\": was %d, clamped to %d",
pslot_id,
2831 "player%d.border_vision",
2838 "(%d) from the loaded game does not match the number of "
2850 "Invalid team definition for player %s (nb %d).",
2866 "players.shuffled_player_%d", 0) >= 0) {
2884 "players.shuffled_player_%d",
i);
2887 log_sg(
"Missing player shuffle information (index %d) "
2888 "- reshuffle player list!",
i);
2892 log_sg(
"Player shuffle %d used two times "
2893 "- reshuffle player list!",
shuffle);
2915 "Invalid player shuffle data!");
2923 log_debug(
"[load shuffle] id: %3d => slot: %3d | slot %3d: %s",
2964 if (
is_ai(pplayer)) {
2965 log_normal(
_(
"%s has been added as %s level AI-controlled player "
2970 log_normal(
_(
"%s has been added as human player."),
2994 log_sg(
_(
"%s had invalid nation; changing to %s."),
3010 log_sg(
"Illegal alliance structure detected: "
3011 "%s alliance to %s reduced to peace treaty.",
3025 pcity->server.illness
3027 &(pcity->illness_trade),
NULL);
3054 BV_CLR_ALL(pplayer->server.really_gives_vision);
3065 "player%d.diplstate%d.gives_shared_vision", plr1, plr2)) {
3081 _(
"%s did not give shared vision to team member %s."),
3087 _(
"%s did not give shared vision to team member %s."),
3107 log_sg(
"%s doing illegal activity in savegame!",
3109 log_sg(
"Activity: %s, Target: %s, Tile: (%d, %d), Terrain: %s",
3156 "player%d.username",
plrno));
3158 "player%d.unassigned_user",
plrno),
3162 "player%d.orig_username",
3166 "player%d.ranked_username",
3169 "player%d.unassigned_ranked",
plrno),
3172 "player%d.delegation_username",
3209 "player%d.target_government_name",
plrno);
3217 "player%d.revolution_finishes",
plrno);
3237 log_sg(
"No valid diplomatic state type between players %d and %d",
3249 log_sg(
"No valid diplomatic max_state between players %d and %d",
3257 if (
ds->type ==
DS_WAR &&
ds->first_contact_turn <= 0) {
3259 "Player%d: War with player %d who has never been met. "
3260 "Reverted to No Contact state.",
plrno,
i);
3267 "Player%d: closest diplstate to player %d less than current. "
3269 ds->max_state =
ds->type;
3272 ds->first_contact_turn =
3274 "%s.first_contact_turn",
buf);
3277 ds->has_reason_to_cancel =
3279 "%s.has_reason_to_cancel",
buf);
3280 ds->contact_turns_left =
3282 "%s.contact_turns_left",
buf);
3313 "player%d.ai.level",
plrno);
3329 "player%d.ai.skill_level",
3334 "player%d.ai.barb_type",
plrno);
3338 log_sg(
"Player%d: Invalid barbarian type \"%s\". "
3366 if (style ==
NULL) {
3368 log_sg(
"Player%d: unsupported city_style_name \"%s\". "
3375 "player%d.idle_turns",
plrno),
3378 "player%d.is_male",
plrno);
3380 "player%d.is_alive",
plrno),
3383 "player%d.turns_alive",
plrno),
3386 "player%d.last_war",
plrno),
3389 "player%d.phase_done",
plrno);
3391 "player%d.gold",
plrno),
3394 "player%d.rates.tax",
plrno),
3397 "player%d.rates.science",
plrno),
3400 "player%d.rates.luxury",
plrno),
3404 "player%d.research.bulbs_last_turn",
plrno);
3420 "player%d.trait%d.mod",
plrno,
i),
3432 "player%d.achievement_count",
plrno);
3435 for (
i = 0;
i < count;
i++) {
3441 "player%d.achievement%d.name",
plrno,
i);
3445 "Unknown achievement \"%s\".",
name);
3448 "player%d.achievement%d.first",
3453 "Multiple players listed as first to get achievement \"%s\".",
3468 "score%d.happy",
plrno);
3471 "score%d.content",
plrno);
3474 "score%d.unhappy",
plrno);
3477 "score%d.angry",
plrno);
3485 for (
i = 0;
i <
loading->specialist.size;
i++) {
3488 "score%d.specialists%d",
plrno,
i);
3493 "score%d.wonders",
plrno);
3496 "score%d.techs",
plrno);
3499 "score%d.techout",
plrno);
3502 "score%d.landarea",
plrno);
3505 "score%d.settledarea",
plrno);
3508 "score%d.population",
plrno);
3511 "score%d.cities",
plrno);
3514 "score%d.units",
plrno);
3517 "score%d.pollution",
plrno);
3520 "score%d.literacy",
plrno);
3523 "score%d.bnp",
plrno);
3526 "score%d.mfg",
plrno);
3529 "score%d.spaceship",
plrno);
3532 "score%d.units_built",
plrno);
3535 "score%d.units_killed",
plrno);
3538 "score%d.units_lost",
plrno);
3542 "score%d.culture",
plrno);
3545 "score%d.total",
plrno);
3558 "%s.state", prefix),
3564 "%s.structurals", prefix),
3567 "%s.components", prefix),
3570 "%s.modules", prefix),
3576 "%s.propulsion", prefix),
3579 "%s.habitation", prefix),
3582 "%s.life_support", prefix),
3585 "%s.solar_panels", prefix),
3592 "Undefined value '%c' within '%s.structure'.",
st[
i],
3595 if (!(
st[
i] ==
'0')) {
3601 "%s.launch_year", prefix),
3615 "Invalid length for 'player%d.lost_wonders' ("
3618 for (k = 0; k <
loading->improvement.size; k++) {
3620 "Undefined value '%c' within "
3621 "'player%d.lost_wonders'.",
plrno,
str[k]);
3623 if (
str[k] ==
'1') {
3654 "player%d.ncities",
plrno),
3668 "player%d.wl_max_length",
3714 if (city_id != -1) {
3718 if (pcity !=
NULL) {
3732 "Unknown workertask activity %s",
str);
3740 "Unknown workertask target %s",
str);
3746 "player%d.task%d.want",
plrno,
i);
3763 const char *kind, *
name, *
str;
3776 "%s has invalid center tile (%d, %d)",
3806 "Invalid city size: %d, set to %d", value,
size);
3809 for (
i = 0;
i <
loading->specialist.size;
i++) {
3877 "%s.turn_last_built",
citystr),
3886 "%s.currently_building: unknown \"%s\" \"%s\".",
3895 "%s.changed_from: unknown \"%s\" \"%s\".",
3900 "%s.before_change_shields",
citystr);
3903 "%s.caravan_shields",
citystr);
3906 "%s.disbanded_shields",
citystr);
3909 "%s.last_turns_shield_surplus",
3919 if (pcity->
style < 0) {
3934 "Invalid length of '%s.improvements' ("
3937 for (
i = 0;
i <
loading->improvement.size;
i++) {
3939 "Undefined value '%c' within '%s.improvements'.",
3942 if (
str[
i] ==
'1') {
3953 "No worked tiles map defined.");
3966 if (
loading->worked_tiles[ptile->index] == pcity->
id) {
3968 log_sg(
"[%s] '%s' (%d, %d) has worker outside current radius "
3981 loading->worked_tiles[ptile->index] = -1;
3990 log_sg(
"[%s] city center of '%s' (%d,%d) [%d] is worked by '%s' "
3999 log_sg(
"[%s] city center of '%s' (%d,%d) [%d] is empty; repairing",
4011 log_sg(
"[%s] size mismatch for '%s' (%d,%d): size [%d] != "
4012 "(workers [%d] - free worked tiles [%d]) + specialists [%d]",
4025 for (
i = 0;
i <
loading->coptions.size;
i++) {
4058 log_sg(
"Citizens of an invalid nation for %s (player slot %d)!",
4065 "Invalid value for citizens of player %d in %s: %d.",
4078 log_sg(
"City size and number of citizens does not match in %s "
4099 "player%d.nunits",
plrno),
4334 "%s.activity_target",
unitstr);
4367 log_sg(
"Cannot find base %d for %s to build",
4375 log_sg(
"Cannot find road %d for %s to build",
4440 "%s.changed_from_tgt",
unitstr);
4453 "%s.changed_from_target",
unitstr);
4456 "%s.changed_from_base",
unitstr);
4459 "%s.changed_from_road",
unitstr);
4521 "%s.changed_from_count",
unitstr);
4617 "%s.action_decision_want",
unitstr);
4624 "%s.action_decision_tile_x",
unitstr)
4626 "%s.action_decision_tile_y",
unitstr)) {
4664 "%s.orders_vigilant",
unitstr);
4687 for (j = 0; j <
len; j++) {
4692 log_sg(
"Invalid unit orders.");
4729 log_sg(
"Cannot find extra %d for %s to build",
4746 log_sg(
"Cannot find base %d for %s to build",
4759 log_sg(
"Cannot find road %d for %s to build",
4813 "player%d.nunits",
plrno),
4831 "player%d.u%d.transported_by",
4842#ifndef FREECIV_NDEBUG
4871 loading->file, 0,
"player%d.attribute_v2_block_length",
plrno);
4874 log_sg(
"player%d.attribute_v2_block_length=%d too small",
plrno,
4878 log_sg(
"player%d.attribute_v2_block_length=%d too big (max %d)",
4885#ifndef FREECIV_NDEBUG
4891 "player%d.attribute_v2_block_length_quoted",
4895 "player%d.attribute_v2_block_parts",
plrno),
4902 const char *current =
4904 "player%d.attribute_v2_block_data.part%d",
4910 log_debug(
"attribute_v2_block_length_quoted=%d"
4917 "attribute_v2_block_length_quoted=%d"
4921#ifndef FREECIV_NDEBUG
4941 "player%d.dc_total",
plrno);
4966 "game.save_private_map")) {
4981 if (
NULL != pcity) {
4995 "player%d.map_t%04d",
plrno);
5001 "player%d.map_res%04d",
plrno);
5054 const char *ptr = buffer;
5058 "Savegame corrupt - map line %d not found.",
y);
5065 scanin(&ptr,
",", token,
sizeof(token));
5067 "Savegame corrupt - map size not correct.");
5068 if (
strcmp(token,
"-") == 0) {
5072 "Savegame corrupt - got tile owner=%s in (%d, %d).",
5080 "Savegame corrupt - map size not correct.");
5085 "Savegame corrupt - got extras owner=%s in (%d, %d).",
5098 for (
i = 0;
i < 4;
i++) {
5126 log_sg(
"Skipping seen city %d for player %d.",
i,
plrno);
5141 if (
NULL != pcity) {
5183 "%s has invalid owner (%d); skipping.",
citystr,
id);
5189 "%s has invalid id (%d); skipping.",
citystr,
id);
5196 "Invalid city size: %d; set to %d.",
size, city_size);
5204 "Invalid length of '%s.improvements' ("
5207 for (
i = 0;
i <
loading->improvement.size;
i++) {
5209 "Undefined value '%c' within '%s.improvements'.",
5212 if (
str[
i] ==
'1') {
5282 for (
i = 0;
i < count;
i++) {
5284 "research.r%d.number",
i),
5288 "Invalid research number %d in 'research.r%d.number'",
5292 "research.r%d.goal",
i);
5295 "research.r%d.techs",
i),
5299 "research.r%d.futuretech",
i),
5303 "research.r%d.bulbs",
i),
5307 "research.r%d.bulbs_before",
i),
5310 "research.r%d.saved",
i);
5312 "research.r%d.now",
i);
5315 "research.r%d.got_tech",
i),
5324 "Invalid length of 'research.r%d.done' ("
5327 for (j = 0; j <
loading->technology.size; j++) {
5329 "Undefined value '%c' within 'research.r%d.done'.",
5332 if (
str[j] ==
'1') {
5382 "treaty%d.plr0", tidx)) !=
NULL ;
5395 log_error(
"Treaty between unknown players %s and %s", plr0, plr1);
5403 "treaty%d.clause%d.type",
5422 log_error(
"Clause giver %s is not participant of the treaty"
5423 "between %s and %s",
plrx, plr0, plr1);
5430 "treaty%d.clause%d.value",
5441 "treaty%d.accept0", tidx);
5443 "treaty%d.accept1", tidx);
5518 log_error(
"Invalid map image definition %4d: %s.",
i, p);
5548 log_verbose(
"Max players lower than current players, fixing");
5557 log_sg(
"Removing %s unferried %s in %s at (%d, %d)",
5594 log_error(
"[city id: %d] Bad worker task %d.",
5595 pcity->id,
ptask->act);
5609 if (
loading->worked_tiles[ptile->index] != -1) {
5610 log_error(
"[city id: %d] Unused worked tile at (%d, %d).",
5626 log_sg(
_(
"%s had invalid researching technology."),
5636 log_sg(
_(
"%s had invalid technology goal."),
5645 _(
"%s had finished researches count wrong."),
5670 sizeof(
server.game_identifier));
5685 log_sg(
_(
"%s has multiple units of type %s though it should be possible "
5686 "to have only one."),
struct achievement * achievement_by_rule_name(const char *name)
void building_advisor(struct player *pplayer)
bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
void adv_data_phase_done(struct player *pplayer)
const char * ai_name(const struct ai_type *ai)
#define CALL_FUNC_EACH_AI(_func,...)
#define CALL_PLR_AI_FUNC(_func, _player,...)
void ai_traits_init(struct player *pplayer)
Base_type_id base_number(const struct base_type *pbase)
struct extra_type * base_extra_get(const struct base_type *pbase)
struct base_type * get_base_by_gui_type(enum base_gui_type type, const struct unit *punit, const struct tile *ptile)
struct base_type * base_by_number(const Base_type_id id)
void dbv_set(struct dbv *pdbv, int bit)
void dbv_clr_all(struct dbv *pdbv)
void dbv_to_bv(unsigned char *dest, const struct dbv *src)
bool has_capability(const char *cap, const char *capstr)
void citizens_nation_set(struct city *pcity, const struct player_slot *pslot, citizens count)
citizens citizens_count(const struct city *pcity)
void citizens_init(struct city *pcity)
void citizens_update(struct city *pcity, struct player *plr)
void city_map_radius_sq_set(struct city *pcity, int radius_sq)
void city_name_set(struct city *pcity, const char *new_name)
const char * city_name_get(const struct city *pcity)
struct city * create_city_virtual(struct player *pplayer, struct tile *ptile, const char *name)
int city_illness_calc(const struct city *pcity, int *ill_base, int *ill_size, int *ill_trade, int *ill_pollution)
void city_size_set(struct city *pcity, citizens size)
void city_add_improvement(struct city *pcity, const struct impr_type *pimprove)
void destroy_city_virtual(struct city *pcity)
int city_style_by_rule_name(const char *s)
#define cities_iterate_end
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define cities_iterate(pcity)
#define CITY_MAP_MAX_RADIUS_SQ
static citizens city_size_get(const struct city *pcity)
#define output_type_iterate(output)
#define city_owner(_pcity_)
#define FREE_WORKED_TILES
#define city_list_iterate_end
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
#define output_type_iterate_end
void auto_arrange_workers(struct city *pcity)
void city_repair_size(struct city *pcity, int change)
bool city_refresh(struct city *pcity)
static void road(QVariant data1, QVariant data2)
static void base(QVariant data1, QVariant data2)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
void set_ai_level_directer(struct player *pplayer, enum ai_level level)
enum diplstate_type valid_dst_closest(struct player_diplstate *dst)
void init_treaty(struct Treaty *ptreaty, struct player *plr0, struct player *plr1)
bool add_clause(struct Treaty *ptreaty, struct player *pfrom, enum clause_type type, int val, struct player *client_player)
void treaty_add(struct Treaty *ptreaty)
#define IDENTITY_NUMBER_ZERO
struct unit * game_unit_by_number(int id)
void initialize_globals(void)
struct city * game_city_by_number(int id)
#define GAME_DEFAULT_TIMEOUTINTINC
#define GAME_DEFAULT_SCORETURN
#define GAME_DEFAULT_TIMEOUTINT
#define GAME_DEFAULT_TIMEOUTINCMULT
#define GAME_DEFAULT_TIMEOUTINC
#define GAME_DEFAULT_RULESETDIR
#define GAME_DEFAULT_TIMEOUTCOUNTER
#define GAME_DEFAULT_PHASE_MODE
struct government * government_by_rule_name(const char *name)
void idex_register_unit(struct world *iworld, struct unit *punit)
void idex_register_city(struct world *iworld, struct city *pcity)
Impr_type_id improvement_index(const struct impr_type *pimprove)
struct impr_type * improvement_by_rule_name(const char *name)
void adv_city_free(struct city *pcity)
void adv_city_alloc(struct city *pcity)
#define fc_assert_msg(condition, message,...)
#define log_verbose(message,...)
#define fc_assert(condition)
#define log_fatal(message,...)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_error(message,...)
bool startpos_disallow(struct startpos *psp, struct nation_type *pnation)
int sq_map_distance(const struct tile *tile0, const struct tile *tile1)
struct startpos * map_startpos_new(struct tile *ptile)
void map_init_topology(struct civ_map *nmap)
void main_map_allocate(void)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
int map_startpos_count(void)
struct tile * native_pos_to_tile(const struct civ_map *nmap, int nat_x, int nat_y)
bool startpos_allow(struct startpos *psp, struct nation_type *pnation)
#define whole_map_iterate(_map, _tile)
#define index_to_native_pos(pnat_x, pnat_y, mindex)
#define whole_map_iterate_end
void assign_continent_numbers(void)
void player_map_init(struct player *pplayer)
void update_player_tile_last_seen(struct player *pplayer, struct tile *ptile)
void map_claim_ownership(struct tile *ptile, struct player *powner, struct tile *psource, bool claim_bases)
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
bool send_tile_suppression(bool now)
bool really_gives_vision(struct player *me, struct player *them)
void map_know_and_see_all(struct player *pplayer)
bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile)
void tile_claim_bases(struct tile *ptile, struct player *powner)
void map_set_known(struct tile *ptile, struct player *pplayer)
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
void change_playertile_site(struct player_tile *ptile, struct vision_site *new_site)
void map_calculate_borders(void)
void give_shared_vision(struct player *pfrom, struct player *pto)
struct player_tile * map_get_player_tile(const struct tile *ptile, const struct player *pplayer)
bool mapimg_define(const char *maparg, bool check)
bool mapimg_delete(int id)
#define fc_calloc(n, esz)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
const char * multiplier_rule_name(const struct multiplier *pmul)
struct multiplier * multiplier_by_rule_name(const char *name)
Multiplier_type_id multiplier_index(const struct multiplier *pmul)
#define multipliers_iterate(_mul_)
#define multipliers_iterate_end
const char * nation_rule_name(const struct nation_type *pnation)
struct nation_type * nation_of_player(const struct player *pplayer)
struct nation_type * nation_by_rule_name(const char *name)
const char * nation_plural_for_player(const struct player *pplayer)
#define NO_NATION_SELECTED
void event_cache_load(struct section_file *file, const char *section)
bool player_slot_is_used(const struct player_slot *pslot)
struct unit * player_unit_by_number(const struct player *pplayer, int unit_id)
struct player * player_by_number(const int player_id)
bool players_on_same_team(const struct player *pplayer1, const struct player *pplayer2)
int player_slot_count(void)
struct player_slot * player_slot_by_number(int player_id)
int player_number(const struct player *pplayer)
enum dipl_reason pplayer_can_make_treaty(const struct player *p1, const struct player *p2, enum diplstate_type treaty)
const char * player_name(const struct player *pplayer)
int player_slot_max_used_number(void)
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
int player_slot_index(const struct player_slot *pslot)
struct player * player_by_name(const char *name)
bool player_has_flag(const struct player *pplayer, enum plr_flag_id flag)
struct city * player_city_by_number(const struct player *pplayer, int city_id)
int player_index(const struct player *pplayer)
bool player_set_nation(struct player *pplayer, struct nation_type *pnation)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
struct player_slot * slots
#define players_iterate_end
@ DIPL_ALLIANCE_PROBLEM_THEM
@ DIPL_ALLIANCE_PROBLEM_US
#define players_iterate(_pplayer)
#define MAX_ATTRIBUTE_BLOCK
#define player_list_iterate(playerlist, pplayer)
static bool is_barbarian(const struct player *pplayer)
#define player_slots_iterate(_pslot)
#define player_list_iterate_end
#define players_iterate_alive_end
#define player_slots_iterate_end
#define players_iterate_alive(_pplayer)
void server_player_set_name(struct player *pplayer, const char *name)
struct player * server_create_player(int player_id, const char *ai_tname, struct rgbcolor *prgbcolor, bool allow_ai_type_fallbacking)
int normal_player_count(void)
void player_limit_to_max_rates(struct player *pplayer)
struct nation_type * pick_a_nation(const struct nation_list *choices, bool ignore_conflicts, bool needs_startpos, enum barbarian_type barb_type)
void set_shuffled_players(int *shuffled_players)
void player_delegation_set(struct player *pplayer, const char *username)
void shuffle_players(void)
void server_remove_player(struct player *pplayer)
void server_player_init(struct player *pplayer, bool initmap, bool needs_team)
void assign_player_colors(void)
void fit_nationset_to_players(void)
RANDOM_STATE fc_rand_state(void)
void fc_rand_set_state(RANDOM_STATE state)
const char * secfile_error(void)
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
const char ** secfile_lookup_str_vec(const struct section_file *secfile, size_t *dim, const char *path,...)
struct entry * secfile_entry_lookup(const struct section_file *secfile, 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,...)
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
struct entry * secfile_entry_by_path(const struct section_file *secfile, const char *path)
struct section * secfile_section_lookup(const struct section_file *secfile, const char *path,...)
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,...)
#define secfile_lookup_enum_default(secfile, defval, specenum_type, path,...)
#define secfile_entry_ignore(_sfile_, _fmt_,...)
struct history_report * history_report_get(void)
bool are_reqs_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
struct universal universal_by_rule_name(const char *kind, const char *value)
bool research_invention_reachable(const struct research *presearch, const Tech_type_id tech)
const char * research_name_translation(const struct research *presearch)
enum tech_state research_invention_set(struct research *presearch, Tech_type_id tech, enum tech_state value)
struct research * research_by_number(int number)
int recalculate_techs_researched(const struct research *presearch)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
void research_update(struct research *presearch)
#define researches_iterate(_presearch)
#define researches_iterate_end
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
bool rgbcolor_load(struct section_file *file, struct rgbcolor **prgbcolor, char *path,...)
struct extra_type * road_extra_get(const struct road_type *proad)
Road_type_id road_number(const struct road_type *proad)
struct road_type * road_by_number(Road_type_id id)
struct road_type * road_by_compat_special(enum road_compat compat)
bool load_rulesets(const char *restore, const char *alt, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
#define sanity_check_city(x)
struct extra_type * resource_by_identifier(const char identifier)
static struct compatibility compat[]
void sg_load_compat(struct loaddata *loading, enum sgf_version format_class)
enum ai_level ai_level_convert(int old_level)
int ascii_hex2bin(char ch, int halfbyte)
struct extra_type * special_extra_get(int spe)
enum tile_special_type special_by_rule_name(const char *name)
void sg_load_post_load_compat(struct loaddata *loading, enum sgf_version format_class)
const char * special_rule_name(enum tile_special_type type)
#define sg_check_ret(...)
#define sg_warn(condition, message,...)
#define sg_failure_ret_val(condition, _val, message,...)
#define sg_failure_ret(condition, message,...)
#define MAX_TRADE_ROUTES_OLD
#define sg_regr(fixversion, message,...)
#define sg_warn_ret_val(condition, _val, message,...)
static void unit_ordering_apply(void)
static void sg_load_players_basic(struct loaddata *loading)
static struct loaddata * loaddata_new(struct section_file *file)
#define ACTIVITY_OLD_POLLUTION_SG2
static void sg_load_map_known(struct loaddata *loading)
#define halfbyte_iterate_roads_end
static struct extra_type * char2resource(char c)
static void sg_load_map_owner(struct loaddata *loading)
#define halfbyte_iterate_extras_end
static void sg_load_map_tiles_roads(struct loaddata *loading)
#define halfbyte_iterate_extras(e, num_extras_types)
static void sg_load_map(struct loaddata *loading)
static enum unit_orders char2order(char order)
static int unquote_block(const char *const quoted_, void *dest, int dest_length)
static void sg_bases_set_bv(bv_extras *extras, char ch, struct base_type **idx)
#define LOAD_MAP_CHAR(ch, ptile, SET_XY_CHAR, secfile, secpath,...)
#define ACTIVITY_OLD_RAILROAD
static void sg_load_player_city_citizens(struct loaddata *loading, struct player *plr, struct city *pcity, const char *citystr)
static void sg_load_player_cities(struct loaddata *loading, struct player *plr)
static void sg_load_map_tiles(struct loaddata *loading)
static char activity2char(int activity)
static void sg_load_savefile(struct loaddata *loading)
#define ACTIVITY_OLD_FALLOUT_SG2
static bool sg_load_player_unit(struct loaddata *loading, struct player *plr, struct unit *punit, const char *unitstr)
static void set_unit_activity_base(struct unit *punit, Base_type_id base)
static bool sg_load_player_city(struct loaddata *loading, struct player *plr, struct city *pcity, const char *citystr, int wlist_max_length)
static void sg_load_settings(struct loaddata *loading)
static void sg_bases_set_dbv(struct dbv *extras, char ch, struct base_type **idx)
static void sg_load_player_units(struct loaddata *loading, struct player *plr)
#define halfbyte_iterate_special(s, num_specials_types)
void savegame2_load(struct section_file *file)
static void sg_load_researches(struct loaddata *loading)
#define halfbyte_iterate_bases_end
static void sg_load_map_worked(struct loaddata *loading)
static void sg_load_random(struct loaddata *loading)
#define halfbyte_iterate_special_end
#define halfbyte_iterate_bases(b, num_bases_types)
static void sg_load_player_units_transport(struct loaddata *loading, struct player *plr)
static void sg_load_history(struct loaddata *loading)
static int char2activity(char activity)
#define ORDER_OLD_BUILD_WONDER
static void sg_load_map_tiles_specials(struct loaddata *loading, bool rivers_overlay)
static void sg_load_script(struct loaddata *loading)
static void sg_load_scenario(struct loaddata *loading)
static void sg_load_ruleset(struct loaddata *loading)
static void sg_load_game(struct loaddata *loading)
static void sg_load_player_main(struct loaddata *loading, struct player *plr)
#define ACTIVITY_OLD_ROAD
static void sg_load_treaties(struct loaddata *loading)
static void sg_extras_set_bv(bv_extras *extras, char ch, struct extra_type **idx)
static void set_unit_activity_road(struct unit *punit, Road_type_id road)
static Tech_type_id technology_load(struct section_file *file, const char *path, int plrno)
static enum direction8 char2dir(char dir)
static void sg_load_map_tiles_resources(struct loaddata *loading)
#define ORDER_OLD_BUILD_CITY
static struct terrain * char2terrain(char ch)
#define ORDER_OLD_DISBAND
static void sg_load_mapimg(struct loaddata *loading)
#define ORDER_OLD_HOMECITY
static void sg_special_set_bv(struct tile *ptile, bv_extras *extras, char ch, const enum tile_special_type *idx, bool rivers_overlay)
static void sg_load_player_attributes(struct loaddata *loading, struct player *plr)
static void sg_load_ruledata(struct loaddata *loading)
static void sg_special_set_dbv(struct tile *ptile, struct dbv *extras, char ch, const enum tile_special_type *idx, bool rivers_overlay)
static void sg_load_player_vision(struct loaddata *loading, struct player *plr)
static void worklist_load(struct section_file *file, int wlist_max_length, struct worklist *pwl, const char *path,...)
static bool sg_load_player_vision_city(struct loaddata *loading, struct player *plr, struct vision_site *pdcity, const char *citystr)
static void sg_roads_set_bv(bv_extras *extras, char ch, struct road_type **idx)
static void sg_roads_set_dbv(struct dbv *extras, char ch, struct road_type **idx)
static void sg_load_map_startpos(struct loaddata *loading)
static void loaddata_destroy(struct loaddata *loading)
static void sg_load_players(struct loaddata *loading)
#define ORDER_OLD_TRADE_ROUTE
static void sg_load_map_tiles_extras(struct loaddata *loading)
static void sg_load_sanitycheck(struct loaddata *loading)
static void sg_load_event_cache(struct loaddata *loading)
static void sg_load_map_tiles_bases(struct loaddata *loading)
static void sg_extras_set_dbv(struct dbv *extras, char ch, struct extra_type **idx)
#define ACTIVITY_LAST_SAVEGAME2
static int sg_order_to_action(int order, struct unit *act_unit, struct tile *tgt_tile)
#define halfbyte_iterate_roads(r, num_roads_types)
void calc_civ_score(struct player *pplayer)
void script_server_state_load(struct section_file *file)
void settings_game_load(struct section_file *file, const char *section)
struct setting_list * level[OLEVELS_NUM]
bool str_to_int(const char *str, int *pint)
bool is_base64url(const char *s)
char scanin(const char **buf, char *delimiters, char *dest, int size)
void randomize_base64url_string(char *s, size_t n)
#define CLIP(lower, current, upper)
void spaceship_calc_derived(struct player_spaceship *ship)
void spaceship_init(struct player_spaceship *ship)
#define NUM_SS_STRUCTURALS
struct specialist * specialist_by_rule_name(const char *name)
Specialist_type_id specialist_index(const struct specialist *sp)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
#define DEFAULT_SPECIALIST
void server_game_init(bool keep_ruleset_value)
const char * aifill(int amount)
bool game_was_started(void)
void identity_number_reserve(int id)
struct server_arguments srvarg
void init_game_seed(void)
void update_nations_with_startpos(void)
void server_game_free(void)
struct worker_task_list * task_reqs
enum city_wl_cancel_behavior wlcb
struct built_status built[B_LAST]
int last_turns_shield_surplus
bv_city_options city_options
enum city_acquire_type acquire_t
struct trade_route_list * routes
struct universal production
int before_change_shields
citizens specialists[SP_MAX]
struct city::@17::@19 server
struct universal changed_from
struct unit_list * units_supported
struct packet_scenario_description scenario_desc
struct packet_ruleset_control control
struct packet_game_info info
char rulesetdir[MAX_LEN_NAME]
struct packet_scenario_info scenario
char orig_game_version[MAX_LEN_NAME]
struct civ_game::@31::@35 server
struct civ_map::@42::@44 server
enum map_generator generator
struct section_file * file
int great_wonder_owners[B_LAST]
bool global_advances[A_LAST]
enum ai_level skill_level
enum phase_mode_type phase_mode
char description[MAX_LEN_CONTENT]
bool allow_ai_type_fallback
char authors[MAX_LEN_PACKET/3]
enum ai_level skill_level
enum barbarian_type barbarian_type
int love[MAX_NUM_PLAYER_SLOTS]
struct player * extras_owner
struct city_list * cities
struct player_ai ai_common
struct government * target_government
char username[MAX_LEN_NAME]
struct government * government
char ranked_username[MAX_LEN_NAME]
struct player_economic economic
struct player_spaceship spaceship
struct attribute_block_s attribute_block
struct player_score score
struct multiplier_value multipliers[MAX_NUM_MULTIPLIERS]
struct nation_type * nation
struct nation_style * style
struct player::@70::@72 server
char orig_username[MAX_LEN_NAME]
char metaserver_addr[256]
enum action_decision action_decision_want
enum unit_activity activity
struct extra_type * changed_from_target
struct unit::@81::@84 server
struct extra_type * activity_target
enum unit_activity changed_from
struct player * nationality
struct tile * action_decision_tile
enum server_side_agent ssa_controller
int city_style(struct city *pcity)
struct nation_style * style_by_rule_name(const char *name)
struct nation_style * style_by_number(int id)
const char * style_rule_name(const struct nation_style *pstyle)
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_strcasecmp(const char *str0, const char *str1)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
#define sz_strlcpy(dest, src)
#define RETURN_VALUE_AFTER_EXIT(_val_)
struct team_slot * team_slot_by_number(int team_id)
bool team_add_player(struct player *pplayer, struct team *pteam)
struct team * team_new(struct team_slot *tslot)
const struct player_list * team_members(const struct team *pteam)
bool is_future_tech(Tech_type_id tech)
struct advance * valid_advance_by_number(const Tech_type_id id)
struct advance * advance_by_rule_name(const char *name)
Tech_type_id advance_number(const struct advance *padvance)
struct terrain * terrain_by_rule_name(const char *name)
const char * terrain_rule_name(const struct terrain *pterrain)
bool terrain_has_resource(const struct terrain *pterrain, const struct extra_type *presource)
#define terrain_type_iterate(_p)
#define TERRAIN_UNKNOWN_IDENTIFIER
#define terrain_type_iterate_end
#define RESOURCE_NONE_IDENTIFIER
#define RESOURCE_NULL_IDENTIFIER
bool tile_has_claimable_base(const struct tile *ptile, const struct unit_type *punittype)
void tile_virtual_destroy(struct tile *vtile)
struct tile * tile_virtual_new(const struct tile *ptile)
bool tile_set_label(struct tile *ptile, const char *label)
void tile_set_resource(struct tile *ptile, struct extra_type *presource)
struct city * tile_city(const struct tile *ptile)
void tile_set_worked(struct tile *ptile, struct city *pcity)
#define tile_worked(_tile)
#define tile_terrain(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
struct goods_type * goods_by_number(Goods_type_id id)
void free_unit_orders(struct unit *punit)
bool unit_transport_load(struct unit *pcargo, struct unit *ptrans, bool force)
void set_unit_activity(struct unit *punit, enum unit_activity new_activity)
struct unit * unit_transport_get(const struct unit *pcargo)
bool can_unit_continue_current_activity(const struct civ_map *nmap, struct unit *punit)
void set_unit_activity_targeted(struct unit *punit, enum unit_activity new_activity, struct extra_type *new_target)
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
bool unit_order_list_is_sane(const struct civ_map *nmap, int length, const struct unit_order *orders)
void unit_virtual_destroy(struct unit *punit)
void unit_tile_set(struct unit *punit, struct tile *ptile)
void unit_list_sort_ord_map(struct unit_list *punitlist)
void unit_list_sort_ord_city(struct unit_list *punitlist)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_safe(unitlist, _unit)
#define unit_list_iterate_end
#define unit_list_iterate_safe_end
const struct unit_type * unit_type_get(const struct unit *punit)
int utype_upkeep_cost(const struct unit_type *ut, struct player *pplayer, Output_type_id otype)
struct unit_type * unit_type_by_rule_name(const char *name)
const char * unit_rule_name(const struct unit *punit)
int utype_veteran_levels(const struct unit_type *punittype)
Unit_type_id utype_index(const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define unit_type_iterate(_p)
#define unit_type_iterate_end
void vision_site_size_set(struct vision_site *psite, citizens size)
struct vision * vision_new(struct player *pplayer, struct tile *ptile)
bool vision_reveal_tiles(struct vision *vision, bool reveal_tiles)
struct vision_site * vision_site_new(int identity, struct tile *location, struct player *owner)
void vision_site_destroy(struct vision_site *psite)
bool worker_task_is_sane(struct worker_task *ptask)
#define worker_task_list_iterate(tasklist, ptask)
#define worker_task_list_iterate_end
void worklist_init(struct worklist *pwl)