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[MAP_NATIVE_WIDTH + 1]; \
165 int _nat_x, _nat_y; \
167 for (_nat_y = 0; _nat_y < MAP_NATIVE_HEIGHT; _nat_y++) { \
168 for (_nat_x = 0; _nat_x < MAP_NATIVE_WIDTH; _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[MAP_NATIVE_WIDTH] = '\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 < MAP_NATIVE_HEIGHT; _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) != MAP_NATIVE_WIDTH) { \
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'", MAP_NATIVE_WIDTH, strlen(_line), buf); \
227 _printed_warning = TRUE; \
230 for (_nat_x = 0; _nat_x < MAP_NATIVE_WIDTH; _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;
728 if (activity ==
achar) {
752 log_error(
_(
"Syntax error in attribute block."));
763 log_error(
_(
"Syntax error in attribute block."));
769 for (
i = 0;
i < length;
i++) {
775 log_error(
_(
"Syntax error in attribute block."));
779 ((
unsigned char *) dest)[
i] =
tmp;
809 for (
i = 0;
i <
pwl->length;
i++) {
863 if (!
pch ||
ch ==
'\0') {
864 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
870 for (
i = 0;
i < 4;
i++) {
873 if (pextra ==
NULL) {
896 if (!
pch ||
ch ==
'\0') {
897 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
903 for (
i = 0;
i < 4;
i++) {
906 if (pextra ==
NULL) {
930 if (!
pch ||
ch ==
'\0') {
931 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
937 for (
i = 0;
i < 4;
i++) {
958 if (
bin & (1 <<
i)) {
1070 if (!
pch ||
ch ==
'\0') {
1071 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1077 for (
i = 0;
i < 4;
i++) {
1098 if (
bin & (1 <<
i)) {
1209 if (!
pch ||
ch ==
'\0') {
1210 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1216 for (
i = 0;
i < 4;
i++) {
1222 if (
bin & (1 <<
i)) {
1240 if (!
pch ||
ch ==
'\0') {
1241 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1247 for (
i = 0;
i < 4;
i++) {
1253 if (
bin & (1 <<
i)) {
1271 if (!
pch ||
ch ==
'\0') {
1272 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1278 for (
i = 0;
i < 4;
i++) {
1284 if (
bin & (1 <<
i)) {
1302 if (!
pch ||
ch ==
'\0') {
1303 log_sg(
"Unknown hex value: '%c' (%d)",
ch,
ch);
1309 for (
i = 0;
i < 4;
i++) {
1315 if (
bin & (1 <<
i)) {
1346 if (pterrain->identifier ==
ch) {
1351 log_fatal(
"Unknown terrain identifier '%c' in savegame.",
ch);
1363 const char *path,
int plrno)
1406 "savefile.rulesetdir");
1414 if (version >= 30) {
1423 log_verbose(
"Savegame specified ruleset '%s'. Really loading '%s'.",
1460 "savefile.last_updated_as_year");
1465 "savefile.improvement_size");
1466 if (
loading->improvement.size) {
1469 "savefile.improvement_vector");
1471 "Failed to load improvement order: %s",
1478 "savefile.technology_size");
1479 if (
loading->technology.size) {
1482 "savefile.technology_vector");
1484 "Failed to load technology order: %s",
1491 "savefile.activities_size");
1492 if (
loading->activities.size) {
1495 "savefile.activities_vector");
1497 "Failed to load activity order: %s",
1504 "savefile.trait_size");
1508 "savefile.trait_vector");
1510 "Failed to load trait order: %s",
1517 "savefile.extras_size");
1524 "savefile.extras_vector");
1526 "Failed to load extras order: %s",
1529 "Number of extras defined by the ruleset (= %d) are "
1530 "lower than the number in the savefile (= %d).",
1535 for (j = 0; j <
loading->extra.size; j++) {
1539 for (; j <
nmod; j++) {
1547 "savefile.multipliers_size");
1548 if (
loading->multiplier.size) {
1553 "savefile.multipliers_vector");
1555 "Failed to load multipliers order: %s",
1560 sizeof(*
loading->multiplier.order));
1561 for (j = 0; j <
loading->multiplier.size; j++) {
1563 if (!
loading->multiplier.order[j]) {
1564 log_verbose(
"Multiplier \"%s\" in savegame but not in ruleset, "
1574 "savefile.specials_size");
1581 "savefile.specials_vector");
1583 "Failed to load specials order: %s",
1598 sizeof(*
loading->special.order));
1599 for (j = 0; j <
loading->special.size; j++) {
1611 for (; j <
nmod; j++) {
1619 "savefile.bases_size");
1626 "savefile.bases_vector");
1628 "Failed to load bases order: %s",
1633 for (j = 0; j <
loading->base.size; j++) {
1638 "Unknown base type %s in savefile.",
1641 if (pextra !=
NULL) {
1648 for (; j <
nmod; j++) {
1656 "savefile.roads_size");
1663 "savefile.roads_vector");
1665 "Failed to load roads order: %s",
1668 "Number of roads defined by the ruleset (= %d) are "
1669 "lower than the number in the savefile (= %d).",
1674 for (j = 0; j <
loading->road.size; j++) {
1677 if (pextra !=
NULL) {
1684 for (; j <
nmod; j++) {
1692 "savefile.specialists_size");
1693 if (
loading->specialist.size) {
1699 "savefile.specialists_vector");
1701 "Failed to load specialists order: %s",
1704 "Number of specialists defined by the ruleset (= %d) are "
1705 "lower than the number in the savefile (= %d).",
1713 for (j = 0; j <
loading->specialist.size; j++) {
1717 for (; j <
nmod; j++) {
1725 "savefile.diplstate_type_size");
1728 "Failed to load diplomatic state type order: %s",
1736 "savefile.diplstate_type_vector");
1739 sizeof(*
loading->ds_t.order));
1741 for (j = 0; j <
loading->ds_t.size; j++) {
1752 "savefile.city_options_size");
1755 const char *
modname_old[] = {
"Disband",
"Sci_Specialists",
"Tax_Specialists" };
1760 if (
loading->coptions.size > 0) {
1762 "savefile.city_options_vector");
1771 sizeof(*
loading->coptions.order));
1773 for (j = 0; j <
loading->coptions.size; j++) {
1785 pterr->identifier_load =
'\0';
1790 "savefile.terrident%d.name",
i)) !=
NULL) {
1795 "savefile.terrident%d.identifier",
i);
1808 "%s and %s share a saved identifier",
1832 "ruledata.government%d.name",
i));
1838 "ruledata.government%d.changes",
i);
1860 "version 2.2.99 required.");
1868 "game.server_state");
1877 "game.meta_patches");
1886 "game.meta_server"));
1908 "game.phase_mode_stored");
1922 "game.timeoutintinc");
1928 "game.timeoutincmult");
1931 "game.timeoutcounter");
1961 "game.global_advances");
1964 "Invalid length of 'game.global_advances' ("
1967 for (
i = 0;
i <
loading->technology.size;
i++) {
1969 "Undefined value '%c' within 'game.global_advances'.",
1971 if (
str[
i] ==
'1') {
2026 for (
i = 0;
i < 8;
i++) {
2094 if (
buf[0] !=
'\0') {
2099 "scenario.authors");
2100 if (
buf[0] !=
'\0') {
2107 "scenario.description");
2108 if (
buf[0] !=
'\0') {
2120 "scenario.startpos_nations");
2124 "scenario.prevent_new_cities");
2125 if (
loading->version < 20599) {
2136 "scenario.lake_flooding");
2139 "scenario.handmade");
2142 "scenario.allow_ai_type_fallback");
2148 "Invalid scenario definition (server state '%s' and "
2289 const char *spec_sprite;
2298 if (
NULL != ptile->spec_sprite) {
2299 ptile->spec_sprite =
fc_strdup(spec_sprite);
2301 if (label !=
NULL) {
2319 loading->file,
"map.e%02d_%04d", j);
2335 loading->file,
"map.b%02d_%04d", j);
2351 loading->file,
"map.r%02d_%04d", j);
2380 loading->special.order + 4 * j,
2382 loading->file,
"map.spe%02d_%04d", j);
2395 loading->file,
"map.res%04d");
2399 if (
NULL == ptile->resource) {
2441 "map.startpos%d.y",
i)) {
2442 log_sg(
"Warning: Undefined coordinates for startpos %d",
i);
2447 if (
NULL == ptile) {
2448 log_error(
"Start position native coordinates (%d, %d) do not exist "
2454 "map.startpos%d.exclude",
i);
2459 "map.startpos%d.nations",
i);
2465 for (start =
buf - 1;
NULL != start; start = end) {
2488 log_verbose(
"Number of starts (%d) are lower than rules.max_players "
2489 "(%d), lowering rules.max_players.",
2521 "map.owner%04d",
y);
2523 "map.source%04d",
y);
2525 "map.eowner%04d",
y);
2545 "Map size not correct (map.owner%d).",
y);
2550 "Got map owner %s in (%d, %d).",
token1,
x,
y);
2556 "Map size not correct (map.source%d).",
y);
2561 "Got map source %s in (%d, %d).",
token2,
x,
y);
2568 "Map size not correct (map.eowner%d).",
y);
2573 "Got base owner %s in (%d, %d).",
token3,
x,
y);
2598 "City worked map not loaded!");
2601 sizeof(*
loading->worked_tiles));
2606 const char *ptr = buffer;
2609 "Savegame corrupt - map line %d not found.",
y);
2615 scanin(&ptr,
",", token,
sizeof(token));
2617 "Savegame corrupt - map size not correct.");
2618 if (
strcmp(token,
"-") == 0) {
2622 "Savegame corrupt - got tile worked by city "
2623 "id=%s in (%d, %d).", token,
x,
y);
2646 "game.save_known")) {
2651 for (j = 0; j < 8; j++) {
2652 for (
i = 0;
i < 4;
i++) {
2659 loading->file,
"map.k%02d_%04d",
l * 8 + j);
2715 "players.destroyed_wonders");
2718 "Invalid length for 'players.destroyed_wonders' ("
2721 for (k = 0; k <
loading->improvement.size; k++) {
2723 "Undefined value '%c' within "
2724 "'players.destroyed_wonders'.",
str[k]);
2726 if (
str[k] ==
'1') {
2739 "players.identity_number_used");
2768 log_sg(
"Game has started, yet player %d has no color defined.",
2800 for (k = 0; k <
loading->multiplier.size; k++) {
2807 "player%d.multiplier%d.val",
2813 log_verbose(
"Player %d had illegal value for multiplier \"%s\": "
2822 "player%d.multiplier%d.target",
2828 log_verbose(
"Player %d had illegal value for multiplier_target "
2829 "\"%s\": was %d, clamped to %d",
pslot_id,
2842 "player%d.border_vision",
2849 "(%d) from the loaded game does not match the number of "
2861 "Invalid team definition for player %s (nb %d).",
2877 "players.shuffled_player_%d", 0) >= 0) {
2895 "players.shuffled_player_%d",
i);
2898 log_sg(
"Missing player shuffle information (index %d) "
2899 "- reshuffle player list!",
i);
2903 log_sg(
"Player shuffle %d used two times "
2904 "- reshuffle player list!",
shuffle);
2926 "Invalid player shuffle data!");
2934 log_debug(
"[load shuffle] id: %3d => slot: %3d | slot %3d: %s",
2975 if (
is_ai(pplayer)) {
2976 log_normal(
_(
"%s has been added as %s level AI-controlled player "
2981 log_normal(
_(
"%s has been added as human player."),
3005 log_sg(
_(
"%s had invalid nation; changing to %s."),
3021 log_sg(
"Illegal alliance structure detected: "
3022 "%s alliance to %s reduced to peace treaty.",
3065 BV_CLR_ALL(pplayer->server.really_gives_vision);
3076 "player%d.diplstate%d.gives_shared_vision", plr1, plr2)) {
3092 _(
"%s did not give shared vision to team member %s."),
3098 _(
"%s did not give shared vision to team member %s."),
3118 log_sg(
"%s doing illegal activity in savegame!",
3120 log_sg(
"Activity: %s, Target: %s, Tile: (%d, %d), Terrain: %s",
3167 "player%d.username",
plrno));
3169 "player%d.unassigned_user",
plrno),
3173 "player%d.orig_username",
3177 "player%d.ranked_username",
3180 "player%d.unassigned_ranked",
plrno),
3183 "player%d.delegation_username",
3220 "player%d.target_government_name",
plrno);
3228 "player%d.revolution_finishes",
plrno);
3248 log_sg(
"No valid diplomatic state type between players %d and %d",
3260 log_sg(
"No valid diplomatic max_state between players %d and %d",
3268 if (
ds->type ==
DS_WAR &&
ds->first_contact_turn <= 0) {
3270 "Player%d: War with player %d who has never been met. "
3271 "Reverted to No Contact state.",
plrno,
i);
3278 "Player%d: closest diplstate to player %d less than current. "
3280 ds->max_state =
ds->type;
3283 ds->first_contact_turn =
3285 "%s.first_contact_turn",
buf);
3288 ds->has_reason_to_cancel =
3290 "%s.has_reason_to_cancel",
buf);
3291 ds->contact_turns_left =
3293 "%s.contact_turns_left",
buf);
3324 "player%d.ai.level",
plrno);
3340 "player%d.ai.skill_level",
3345 "player%d.ai.barb_type",
plrno);
3349 log_sg(
"Player%d: Invalid barbarian type \"%s\". "
3377 if (style ==
NULL) {
3379 log_sg(
"Player%d: unsupported city_style_name \"%s\". "
3386 "player%d.idle_turns",
plrno),
3389 "player%d.is_male",
plrno);
3391 "player%d.is_alive",
plrno),
3394 "player%d.turns_alive",
plrno),
3397 "player%d.last_war",
plrno),
3400 "player%d.phase_done",
plrno);
3402 "player%d.gold",
plrno),
3405 "player%d.rates.tax",
plrno),
3408 "player%d.rates.science",
plrno),
3411 "player%d.rates.luxury",
plrno),
3415 "player%d.research.bulbs_last_turn",
plrno);
3431 "player%d.trait%d.mod",
plrno,
i),
3443 "player%d.achievement_count",
plrno);
3446 for (
i = 0;
i < count;
i++) {
3452 "player%d.achievement%d.name",
plrno,
i);
3456 "Unknown achievement \"%s\".",
name);
3459 "player%d.achievement%d.first",
3464 "Multiple players listed as first to get achievement \"%s\".",
3479 "score%d.happy",
plrno);
3482 "score%d.content",
plrno);
3485 "score%d.unhappy",
plrno);
3488 "score%d.angry",
plrno);
3496 for (
i = 0;
i <
loading->specialist.size;
i++) {
3499 "score%d.specialists%d",
plrno,
i);
3504 "score%d.wonders",
plrno);
3507 "score%d.techs",
plrno);
3510 "score%d.techout",
plrno);
3513 "score%d.landarea",
plrno);
3516 "score%d.settledarea",
plrno);
3519 "score%d.population",
plrno);
3522 "score%d.cities",
plrno);
3525 "score%d.units",
plrno);
3528 "score%d.pollution",
plrno);
3531 "score%d.literacy",
plrno);
3534 "score%d.bnp",
plrno);
3537 "score%d.mfg",
plrno);
3540 "score%d.spaceship",
plrno);
3543 "score%d.units_built",
plrno);
3546 "score%d.units_killed",
plrno);
3549 "score%d.units_lost",
plrno);
3553 "score%d.culture",
plrno);
3556 "score%d.total",
plrno);
3569 "%s.state", prefix),
3575 "%s.structurals", prefix),
3578 "%s.components", prefix),
3581 "%s.modules", prefix),
3587 "%s.propulsion", prefix),
3590 "%s.habitation", prefix),
3593 "%s.life_support", prefix),
3596 "%s.solar_panels", prefix),
3603 "Undefined value '%c' within '%s.structure'.",
st[
i],
3606 if (!(
st[
i] ==
'0')) {
3612 "%s.launch_year", prefix),
3626 "Invalid length for 'player%d.lost_wonders' ("
3629 for (k = 0; k <
loading->improvement.size; k++) {
3631 "Undefined value '%c' within "
3632 "'player%d.lost_wonders'.",
plrno,
str[k]);
3634 if (
str[k] ==
'1') {
3665 "player%d.ncities",
plrno),
3679 "player%d.wl_max_length",
3725 if (city_id != -1) {
3743 "Unknown workertask activity %s",
str);
3751 "Unknown workertask target %s",
str);
3757 "player%d.task%d.want",
plrno,
i);
3774 const char *kind, *
name, *
str;
3787 "%s has invalid center tile (%d, %d)",
3807 if (
pcity->original != plr) {
3817 "Invalid city size: %d, set to %d", value,
size);
3820 for (
i = 0;
i <
loading->specialist.size;
i++) {
3861 pcity->turn_plague =
3873 pcity->turn_founded =
3878 pcity->did_buy = (
i != 0);
3879 if (
i == -1 &&
pcity->turn_founded == -2) {
3888 "%s.turn_last_built",
citystr),
3897 "%s.currently_building: unknown \"%s\" \"%s\".",
3906 "%s.changed_from: unknown \"%s\" \"%s\".",
3909 pcity->before_change_shields =
3911 "%s.before_change_shields",
citystr);
3912 pcity->caravan_shields =
3914 "%s.caravan_shields",
citystr);
3915 pcity->disbanded_shields =
3917 "%s.disbanded_shields",
citystr);
3918 pcity->last_turns_shield_surplus =
3920 "%s.last_turns_shield_surplus",
3930 if (
pcity->style < 0) {
3945 "Invalid length of '%s.improvements' ("
3948 for (
i = 0;
i <
loading->improvement.size;
i++) {
3950 "Undefined value '%c' within '%s.improvements'.",
3953 if (
str[
i] ==
'1') {
3964 "No worked tiles map defined.");
3979 log_sg(
"[%s] '%s' (%d, %d) has worker outside current radius "
3992 loading->worked_tiles[ptile->index] = -1;
4001 log_sg(
"[%s] city center of '%s' (%d,%d) [%d] is worked by '%s' "
4010 log_sg(
"[%s] city center of '%s' (%d,%d) [%d] is empty; repairing",
4022 log_sg(
"[%s] size mismatch for '%s' (%d,%d): size [%d] != "
4023 "(workers [%d] - free worked tiles [%d]) + specialists [%d]",
4036 for (
i = 0;
i <
loading->coptions.size;
i++) {
4069 log_sg(
"Citizens of an invalid nation for %s (player slot %d)!",
4076 "Invalid value for citizens of player %d in %s: %d.",
4089 log_sg(
"City size and number of citizens does not match in %s "
4110 "player%d.nunits",
plrno),
4351 "%s.activity_target",
unitstr);
4384 log_sg(
"Cannot find base %d for %s to build",
4393 log_sg(
"Cannot find road %d for %s to build",
4467 "%s.changed_from_tgt",
unitstr);
4480 "%s.changed_from_target",
unitstr);
4483 "%s.changed_from_base",
unitstr);
4486 "%s.changed_from_road",
unitstr);
4548 "%s.changed_from_count",
unitstr);
4644 "%s.action_decision_want",
unitstr);
4651 "%s.action_decision_tile_x",
unitstr)
4653 "%s.action_decision_tile_y",
unitstr)) {
4691 "%s.orders_vigilant",
unitstr);
4714 for (j = 0; j <
len; j++) {
4719 log_sg(
"Invalid unit orders.");
4756 log_sg(
"Cannot find extra %d for %s to build",
4773 log_sg(
"Cannot find base %d for %s to build",
4786 log_sg(
"Cannot find road %d for %s to build",
4840 "player%d.nunits",
plrno),
4858 "player%d.u%d.transported_by",
4869#ifndef FREECIV_NDEBUG
4898 loading->file, 0,
"player%d.attribute_v2_block_length",
plrno);
4901 log_sg(
"player%d.attribute_v2_block_length=%d too small",
plrno,
4905 log_sg(
"player%d.attribute_v2_block_length=%d too big (max %d)",
4912#ifndef FREECIV_NDEBUG
4918 "player%d.attribute_v2_block_length_quoted",
4922 "player%d.attribute_v2_block_parts",
plrno),
4929 const char *current =
4931 "player%d.attribute_v2_block_data.part%d",
4937 log_debug(
"attribute_v2_block_length_quoted=%d"
4944 "attribute_v2_block_length_quoted=%d"
4948#ifndef FREECIV_NDEBUG
4968 "player%d.dc_total",
plrno);
4993 "game.save_private_map")) {
5022 "player%d.map_t%04d",
plrno);
5028 "player%d.map_res%04d",
plrno);
5081 const char *ptr = buffer;
5085 "Savegame corrupt - map line %d not found.",
y);
5092 scanin(&ptr,
",", token,
sizeof(token));
5094 "Savegame corrupt - map size not correct.");
5095 if (
strcmp(token,
"-") == 0) {
5099 "Savegame corrupt - got tile owner=%s in (%d, %d).",
5107 "Savegame corrupt - map size not correct.");
5112 "Savegame corrupt - got extras owner=%s in (%d, %d).",
5125 for (
i = 0;
i < 4;
i++) {
5153 log_sg(
"Skipping seen city %d for player %d.",
i,
plrno);
5210 "%s has invalid owner (%d); skipping.",
citystr,
id);
5216 "%s has invalid id (%d); skipping.",
citystr,
id);
5223 "Invalid city size: %d; set to %d.",
size, city_size);
5231 "Invalid length of '%s.improvements' ("
5234 for (
i = 0;
i <
loading->improvement.size;
i++) {
5236 "Undefined value '%c' within '%s.improvements'.",
5239 if (
str[
i] ==
'1') {
5309 for (
i = 0;
i < count;
i++) {
5311 "research.r%d.number",
i),
5315 "Invalid research number %d in 'research.r%d.number'",
5319 "research.r%d.goal",
i);
5322 "research.r%d.futuretech",
i),
5326 "research.r%d.bulbs",
i),
5330 "research.r%d.bulbs_before",
i),
5333 "research.r%d.saved",
i);
5335 "research.r%d.now",
i);
5338 "research.r%d.got_tech",
i),
5347 "Invalid length of 'research.r%d.done' ("
5350 for (j = 0; j <
loading->technology.size; j++) {
5352 "Undefined value '%c' within 'research.r%d.done'.",
5355 if (
str[j] ==
'1') {
5405 "treaty%d.plr0", tidx)) !=
NULL ;
5418 log_error(
"Treaty between unknown players %s and %s", plr0, plr1);
5426 "treaty%d.clause%d.type",
5445 log_error(
"Clause giver %s is not participant of the treaty"
5446 "between %s and %s",
plrx, plr0, plr1);
5453 "treaty%d.clause%d.value",
5464 "treaty%d.accept0", tidx);
5466 "treaty%d.accept1", tidx);
5541 log_error(
"Invalid map image definition %4d: %s.",
i, p);
5571 log_verbose(
"Max players lower than current players, fixing");
5580 log_sg(
"Removing %s unferried %s in %s at (%d, %d)",
5617 log_error(
"[city id: %d] Bad worker task %d.",
5632 if (
loading->worked_tiles[ptile->index] != -1) {
5633 log_error(
"[city id: %d] Unused worked tile at (%d, %d).",
5647 log_sg(
_(
"%s had invalid researching technology."),
5657 log_sg(
_(
"%s had invalid technology goal."),
5684 sizeof(
server.game_identifier));
5699 log_sg(
_(
"%s has multiple units of type %s though it should be possible "
5700 "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
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 int const struct action *paction struct unit struct city * pcity
void set_ai_level_directer(struct player *pplayer, enum ai_level level)
enum diplstate_type valid_dst_closest(struct player_diplstate *dst)
void treaty_add(struct treaty *ptreaty)
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)
#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,...)
float secfile_lookup_float_default(const struct section_file *secfile, float def, 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 req_context *other_context, 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 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::@32::@36 server
struct civ_map::@44::@46 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::@73::@75 server
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
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::@84::@87 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)
struct unit * unit_transport_get(const struct unit *pcargo)
bool can_unit_continue_current_activity(const struct civ_map *nmap, struct unit *punit)
enum gen_action activity_default_action(enum unit_activity act)
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 set_unit_activity_targeted(struct unit *punit, enum unit_activity new_activity, struct extra_type *new_target, enum gen_action trigger_action)
void unit_virtual_destroy(struct unit *punit)
void unit_tile_set(struct unit *punit, struct tile *ptile)
void set_unit_activity(struct unit *punit, enum unit_activity new_activity, enum gen_action trigger_action)
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)
#define MAP_NATIVE_HEIGHT