Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/savegame/savegame2.c File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Macros | Functions | Variables
savegame2.c File Reference
`#include <ctype.h>`
`#include <stdarg.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "bitvector.h"`
`#include "fcintl.h"`
`#include "idex.h"`
`#include "log.h"`
`#include "mem.h"`
`#include "rand.h"`
`#include "registry.h"`
`#include "shared.h"`
`#include "support.h"`
`#include "timing.h"`
`#include "achievements.h"`
`#include "ai.h"`
`#include "capability.h"`
`#include "citizens.h"`
`#include "city.h"`
`#include "game.h"`
`#include "government.h"`
`#include "map.h"`
`#include "mapimg.h"`
`#include "movement.h"`
`#include "multipliers.h"`
`#include "packets.h"`
`#include "research.h"`
`#include "rgbcolor.h"`
`#include "specialist.h"`
`#include "unit.h"`
`#include "unitlist.h"`
`#include "version.h"`
`#include "barbarian.h"`
`#include "citizenshand.h"`
`#include "citytools.h"`
`#include "cityturn.h"`
`#include "diplhand.h"`
`#include "maphand.h"`
`#include "meta.h"`
`#include "notify.h"`
`#include "plrhand.h"`
`#include "report.h"`
`#include "ruleset.h"`
`#include "sanitycheck.h"`
`#include "savecompat.h"`
`#include "score.h"`
`#include "settings.h"`
`#include "spacerace.h"`
`#include "srv_main.h"`
`#include "stdinhand.h"`
`#include "techtools.h"`
`#include "unittools.h"`
`#include "advdata.h"`
`#include "advbuilding.h"`
`#include "infracache.h"`
`#include "mapgen.h"`
`#include "mapgen_utils.h"`
`#include "script_server.h"`
`#include "aitraits.h"`
`#include "difficulty.h"`
`#include "savegame2.h"`

Go to the source code of this file.

## Macros

#define | ACTIVITY_OLD_ROAD (ACTIVITY_LAST + 1)
#define | ACTIVITY_OLD_RAILROAD (ACTIVITY_LAST + 2)
#define | ACTIVITY_OLD_POLLUTION_SG2 (ACTIVITY_OLD_RAILROAD + 1)
#define | ACTIVITY_OLD_FALLOUT_SG2 (ACTIVITY_OLD_POLLUTION_SG2 + 1)
#define | ACTIVITY_LAST_SAVEGAME2 (ACTIVITY_OLD_FALLOUT_SG2 + 1)
#define | SAVE_MAP_CHAR(ptile, GET_XY_CHAR, secfile, secpath, ...)
#define | LOAD_MAP_CHAR(ch, ptile, SET_XY_CHAR, secfile, secpath, ...)
#define | halfbyte_iterate_extras(e, num_extras_types)
#define | halfbyte_iterate_extras_end
#define | halfbyte_iterate_special(s, num_specials_types)
#define | halfbyte_iterate_special_end
#define | halfbyte_iterate_bases(b, num_bases_types)
#define | halfbyte_iterate_bases_end
#define | halfbyte_iterate_roads(r, num_roads_types)
#define | halfbyte_iterate_roads_end
#define | TOKEN_SIZE 10
#define | ORDER_OLD_BUILD_CITY (-1)
#define | ORDER_OLD_DISBAND (-2)
#define | ORDER_OLD_BUILD_WONDER (-3)
#define | ORDER_OLD_TRADE_ROUTE (-4)
#define | ORDER_OLD_HOMECITY (-5)

## Functions

static struct loaddata * | loaddata_new (struct section_file *file)
static void | loaddata_destroy (struct loaddata *loading)
static enum unit_orders | char2order (char order)
static enum direction8 | char2dir (char dir)
static char | activity2char (int activity)
static int | char2activity (char activity)
static int | unquote_block (const char *const quoted_, void *dest, int dest_length)
static void | worklist_load (struct section_file *file, int wlist_max_length, struct worklist *pwl, const char *path,...)
static void | unit_ordering_apply (void)
static void | sg_extras_set_dbv (struct dbv *extras, char ch, struct extra_type **idx)
static void | sg_extras_set_bv (bv_extras *extras, char ch, struct extra_type **idx)
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_special_set_bv (struct tile *ptile, bv_extras *extras, char ch, const enum tile_special_type *idx, bool rivers_overlay)
static void | sg_bases_set_dbv (struct dbv *extras, char ch, struct base_type **idx)
static void | sg_bases_set_bv (bv_extras *extras, char ch, struct base_type **idx)
static void | sg_roads_set_dbv (struct dbv *extras, char ch, struct road_type **idx)
static void | sg_roads_set_bv (bv_extras *extras, char ch, struct road_type **idx)
static struct extra_type * | char2resource (char c)
static struct terrain * | char2terrain (char ch)
static Tech_type_id | technology_load (struct section_file *file, const char *path, int plrno)
static void | sg_load_ruleset (struct loaddata *loading)
static void | sg_load_savefile (struct loaddata *loading)
static void | sg_load_game (struct loaddata *loading)
static void | sg_load_ruledata (struct loaddata *loading)
static void | sg_load_random (struct loaddata *loading)
static void | sg_load_script (struct loaddata *loading)
static void | sg_load_scenario (struct loaddata *loading)
static void | sg_load_settings (struct loaddata *loading)
static void | sg_load_map (struct loaddata *loading)
static void | sg_load_map_tiles (struct loaddata *loading)
static void | sg_load_map_tiles_extras (struct loaddata *loading)
static void | sg_load_map_tiles_bases (struct loaddata *loading)
static void | sg_load_map_tiles_roads (struct loaddata *loading)
static void | sg_load_map_tiles_specials (struct loaddata *loading, bool rivers_overlay)
static void | sg_load_map_tiles_resources (struct loaddata *loading)
static void | sg_load_map_startpos (struct loaddata *loading)
static void | sg_load_map_owner (struct loaddata *loading)
static void | sg_load_map_worked (struct loaddata *loading)
static void | sg_load_map_known (struct loaddata *loading)
static void | sg_load_players_basic (struct loaddata *loading)
static void | sg_load_players (struct loaddata *loading)
static void | sg_load_player_main (struct loaddata *loading, struct player *plr)
static void | sg_load_player_cities (struct loaddata *loading, struct player *plr)
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_player_city_citizens (struct loaddata *loading, struct player *plr, struct city *pcity, const char *citystr)
static void | sg_load_player_units (struct loaddata *loading, struct player *plr)
static bool | sg_load_player_unit (struct loaddata *loading, struct player *plr, struct unit *punit, const char *unitstr)
static void | sg_load_player_units_transport (struct loaddata *loading, struct player *plr)
static void | sg_load_player_attributes (struct loaddata *loading, struct player *plr)
static void | sg_load_player_vision (struct loaddata *loading, struct player *plr)
static bool | sg_load_player_vision_city (struct loaddata *loading, struct player *plr, struct vision_site *pdcity, const char *citystr)
static void | sg_load_researches (struct loaddata *loading)
static void | sg_load_event_cache (struct loaddata *loading)
static void | sg_load_treaties (struct loaddata *loading)
static void | sg_load_history (struct loaddata *loading)
static void | sg_load_mapimg (struct loaddata *loading)
static void | sg_load_sanitycheck (struct loaddata *loading)
void | savegame2_load (struct section_file *file)
static void | set_unit_activity_base (struct unit *punit, Base_type_id base)
static void | set_unit_activity_road (struct unit *punit, Road_type_id road)
static int | sg_order_to_action (int order, struct unit *act_unit, struct tile *tgt_tile)

## Variables

bool | sg_success

## Macro Definition Documentation

## ◆ ACTIVITY_LAST_SAVEGAME2

#define ACTIVITY_LAST_SAVEGAME2 (ACTIVITY_OLD_FALLOUT_SG2 + 1)

Definition at line 147 of file savegame2.c.

## ◆ ACTIVITY_OLD_FALLOUT_SG2

#define ACTIVITY_OLD_FALLOUT_SG2 (ACTIVITY_OLD_POLLUTION_SG2 + 1)

Definition at line 146 of file savegame2.c.

## ◆ ACTIVITY_OLD_POLLUTION_SG2

#define ACTIVITY_OLD_POLLUTION_SG2 (ACTIVITY_OLD_RAILROAD + 1)

Definition at line 145 of file savegame2.c.

## ◆ ACTIVITY_OLD_RAILROAD

#define ACTIVITY_OLD_RAILROAD (ACTIVITY_LAST + 2)

Definition at line 144 of file savegame2.c.

## ◆ ACTIVITY_OLD_ROAD

#define ACTIVITY_OLD_ROAD (ACTIVITY_LAST + 1)

Definition at line 143 of file savegame2.c.

## ◆ halfbyte_iterate_bases

#define halfbyte_iterate_bases | ( |  | b,
|  |  | num_bases_types
| ) |  |

Value:
{ \
int b; \
for (b = 0; 4 * b < (num_bases_types); b++) {
incite_cost
char * incite_cost
Definition comments.c:74

Definition at line 265 of file savegame2.c.

## ◆ halfbyte_iterate_bases_end

#define halfbyte_iterate_bases_end

Value:
} \
}

Definition at line 270 of file savegame2.c.

## ◆ halfbyte_iterate_extras

#define halfbyte_iterate_extras | ( |  | e,
|  |  | num_extras_types
| ) |  |

Value:
{ \
int e; \
for (e = 0; 4 * e < (num_extras_types); e++) {

Definition at line 245 of file savegame2.c.

## ◆ halfbyte_iterate_extras_end

#define halfbyte_iterate_extras_end

Value:
} \
}

Definition at line 250 of file savegame2.c.

## ◆ halfbyte_iterate_roads

#define halfbyte_iterate_roads | ( |  | r,
|  |  | num_roads_types
| ) |  |

Value:
{ \
int r; \
for (r = 0; 4 * r < (num_roads_types); r++) {

Definition at line 275 of file savegame2.c.

## ◆ halfbyte_iterate_roads_end

#define halfbyte_iterate_roads_end

Value:
} \
}

Definition at line 280 of file savegame2.c.

## ◆ halfbyte_iterate_special

#define halfbyte_iterate_special | ( |  | s,
|  |  | num_specials_types
| ) |  |

Value:
{ \
enum tile_special_type s; \
for (s = 0; 4 * s < (num_specials_types); s++) {
tile_special_type
tile_special_type
Definition savecompat.h:29

Definition at line 255 of file savegame2.c.

## ◆ halfbyte_iterate_special_end

#define halfbyte_iterate_special_end

Value:
} \
}

Definition at line 260 of file savegame2.c.

## ◆ LOAD_MAP_CHAR

#define LOAD_MAP_CHAR | ( |  | ch,
|  |  | ptile,
|  |  | SET_XY_CHAR,
|  |  | secfile,
|  |  | secpath,
|  |  | ...
| ) |  |

Definition at line 209 of file savegame2.c.

## ◆ ORDER_OLD_BUILD_CITY

#define ORDER_OLD_BUILD_CITY (-1)

Definition at line 286 of file savegame2.c.

## ◆ ORDER_OLD_BUILD_WONDER

#define ORDER_OLD_BUILD_WONDER (-3)

Definition at line 288 of file savegame2.c.

## ◆ ORDER_OLD_DISBAND

#define ORDER_OLD_DISBAND (-2)

Definition at line 287 of file savegame2.c.

## ◆ ORDER_OLD_HOMECITY

#define ORDER_OLD_HOMECITY (-5)

Definition at line 290 of file savegame2.c.

## ◆ ORDER_OLD_TRADE_ROUTE

#define ORDER_OLD_TRADE_ROUTE (-4)

Definition at line 289 of file savegame2.c.

## ◆ SAVE_MAP_CHAR

#define SAVE_MAP_CHAR | ( |  | ptile,
|  |  | GET_XY_CHAR,
|  |  | secfile,
|  |  | secpath,
|  |  | ...
| ) |  |

Value:
{ \
char _line[wld.map.xsize + 1]; \
int _nat_x, _nat_y; \
\
for (_nat_y = 0; _nat_y < wld.map.ysize; _nat_y++) { \
for (_nat_x = 0; _nat_x < wld.map.xsize; _nat_x++) { \
struct tile *ptile = native_pos_to_tile(&(wld.map), _nat_x, _nat_y); \
fc_assert_action(ptile != NULL, continue); \
_line[_nat_x] = (GET_XY_CHAR); \
sg_failure_ret(fc_isprint(_line[_nat_x] & 0x7f), \
"Trying to write invalid map data at position " \
"(%d, %d) for path %s: '%c' (%d)", _nat_x, _nat_y, \
secpath, _line[_nat_x], _line[_nat_x]); \
} \
_line[wld.map.xsize] = '\0'; \
secfile_insert_str(secfile, _line, secpath, ## __VA_ARGS__, _nat_y); \
} \
}
wld
struct world wld
Definition game.c:63
native_pos_to_tile
struct tile * native_pos_to_tile(const struct civ_map *nmap, int nat_x, int nat_y)
Definition map.c:443
civ_map::xsize
int xsize
Definition map_types.h:78
civ_map::ysize
int ysize
Definition map_types.h:78
tile
Definition tile.h:50
world::map
struct civ_map map
Definition world_object.h:38
fc_isprint
bool fc_isprint(char c)
Definition support.c:1243

Definition at line 162 of file savegame2.c.

## ◆ TOKEN_SIZE

#define TOKEN_SIZE 10

Definition at line 284 of file savegame2.c.

## Function Documentation

## ◆ activity2char()

static char activity2char | ( | int | activity | ) |

static

Returns a character identifier for an activity. See also char2activity().

Definition at line 665 of file savegame2.c.

Referenced by char2activity().

## ◆ char2activity()

static int char2activity | ( | char | activity | ) |

static

Returns an activity for a character identifier. See also activity2char().

Definition at line 719 of file savegame2.c.

Referenced by sg_load_player_unit().

## ◆ char2dir()

static enum direction8 char2dir | ( | char | dir | ) |

static

Returns a direction for a character identifier.

Definition at line 636 of file savegame2.c.

Referenced by sg_load_player_unit().

## ◆ char2order()

static enum unit_orders char2order | ( | char | order | ) |

static

Returns an order for a character identifier.

Definition at line 597 of file savegame2.c.

Referenced by sg_load_player_unit().

## ◆ char2resource()

static struct extra_type * char2resource | ( | char | c | ) |

static

Return the resource for the given identifier.

Definition at line 1316 of file savegame2.c.

Referenced by sg_load_map_tiles_resources(), and sg_load_player_vision().

## ◆ char2terrain()

static struct terrain * char2terrain | ( | char | ch | ) |

static

Dereferences the terrain character. See terrains[].identifier example: char2terrain('a') => T_ARCTIC

Definition at line 1331 of file savegame2.c.

Referenced by sg_load_map_tiles(), sg_load_player_vision(), and fc_client::slot_selection_changed().

## ◆ loaddata_destroy()

static void loaddata_destroy | ( | struct loaddata * | loading | ) |

static

Free resources allocated for loaddata item.

Definition at line 512 of file savegame2.c.

Referenced by savegame2_load().

## ◆ loaddata_new()

static struct loaddata * loaddata_new | ( | struct section_file * | file | ) |

static

Create new loaddata item for given section file.

Definition at line 471 of file savegame2.c.

Referenced by savegame2_load().

## ◆ savegame2_load()

void savegame2_load | ( | struct section_file * | file | ) |

Really loading the savegame.

Definition at line 402 of file savegame2.c.

Referenced by savegame_load().

## ◆ set_unit_activity_base()

static void set_unit_activity_base | ( | struct unit * | punit,
|  | Base_type_id | base
| ) |  |

static

Assign a new base building task to unit

Definition at line 573 of file savegame2.c.

Referenced by sg_load_player_unit().

## ◆ set_unit_activity_road()

static void set_unit_activity_road | ( | struct unit * | punit,
|  | Road_type_id | road
| ) |  |

static

Assign a new road building task to unit

Definition at line 583 of file savegame2.c.

Referenced by sg_load_player_unit().

## ◆ sg_bases_set_bv()

static void sg_bases_set_bv | ( | bv_extras * | extras,
|  | char | ch,
|  | struct base_type ** | idx
| ) |  |

static

Helper function for loading bases from a savegame.

'ch' gives the character loaded from the savegame. Bases are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.

Definition at line 1227 of file savegame2.c.

Referenced by sg_load_map_tiles_bases().

## ◆ sg_bases_set_dbv()

static void sg_bases_set_dbv | ( | struct dbv * | extras,
|  | char | ch,
|  | struct base_type ** | idx
| ) |  |

static

Helper function for loading bases from a savegame.

'ch' gives the character loaded from the savegame. Bases are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.

Definition at line 1195 of file savegame2.c.

Referenced by sg_load_player_vision().

## ◆ sg_extras_set_bv()

static void sg_extras_set_bv | ( | bv_extras * | extras,
|  | char | ch,
|  | struct extra_type ** | idx
| ) |  |

static

Helper function for loading extras from a savegame.

'ch' gives the character loaded from the savegame. Extras are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.

Definition at line 888 of file savegame2.c.

Referenced by sg_load_map_tiles_extras().

## ◆ sg_extras_set_dbv()

static void sg_extras_set_dbv | ( | struct dbv * | extras,
|  | char | ch,
|  | struct extra_type ** | idx
| ) |  |

static

Helper function for loading extras from a savegame.

'ch' gives the character loaded from the savegame. Extras are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.

Definition at line 855 of file savegame2.c.

Referenced by sg_load_player_vision().

## ◆ sg_load_event_cache()

static void sg_load_event_cache | ( | struct loaddata * | loading | ) |

static

Load '[event_cache]'.

Definition at line 5347 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_game()

static void sg_load_game | ( | struct loaddata * | loading | ) |

static

Load '[game]'.

Definition at line 1838 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_history()

static void sg_load_history | ( | struct loaddata * | loading | ) |

static

Load '[history]'.

Definition at line 5444 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_map()

static void sg_load_map | ( | struct loaddata * | loading | ) |

static

Load '[map'].

Definition at line 2170 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_map_known()

static void sg_load_map_known | ( | struct loaddata * | loading | ) |

static

Load tile known status

Definition at line 2612 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_owner()

static void sg_load_map_owner | ( | struct loaddata * | loading | ) |

static

Load tile owner information

Definition at line 2481 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_startpos()

static void sg_load_map_startpos | ( | struct loaddata * | loading | ) |

static

Load starting positions for the players from a savegame file. There should be at least enough for every player.

Definition at line 2394 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_tiles()

static void sg_load_map_tiles | ( | struct loaddata * | loading | ) |

static

Load tiles of the map.

Definition at line 2248 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_tiles_bases()

static void sg_load_map_tiles_bases | ( | struct loaddata * | loading | ) |

static

Load bases to map

Definition at line 2304 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_tiles_extras()

static void sg_load_map_tiles_extras | ( | struct loaddata * | loading | ) |

static

Load extras to map

Definition at line 2288 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_tiles_resources()

static void sg_load_map_tiles_resources | ( | struct loaddata * | loading | ) |

static

Load information about resources on map.

Definition at line 2367 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_tiles_roads()

static void sg_load_map_tiles_roads | ( | struct loaddata * | loading | ) |

static

Load roads to map

Definition at line 2320 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_tiles_specials()

static void sg_load_map_tiles_specials | ( | struct loaddata * | loading,
|  | bool | rivers_overlay
| ) |  |

static

Load information about specials on map

Definition at line 2336 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_map_worked()

static void sg_load_map_worked | ( | struct loaddata * | loading | ) |

static

Load worked tiles information

Definition at line 2568 of file savegame2.c.

Referenced by sg_load_map().

## ◆ sg_load_mapimg()

static void sg_load_mapimg | ( | struct loaddata * | loading | ) |

static

Load '[mapimg]'.

Definition at line 5474 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_player_attributes()

static void sg_load_player_attributes | ( | struct loaddata * | loading,
|  | struct player * | plr
| ) |  |

static

Load player (client) attributes data

Definition at line 4844 of file savegame2.c.

Referenced by sg_load_players().

## ◆ sg_load_player_cities()

static void sg_load_player_cities | ( | struct loaddata * | loading,
|  | struct player * | plr
| ) |  |

static

Load city data

Definition at line 3632 of file savegame2.c.

Referenced by sg_load_players().

## ◆ sg_load_player_city()

static bool sg_load_player_city | ( | struct loaddata * | loading,
|  | struct player * | plr,
|  | struct city * | pcity,
|  | const char * | citystr,
|  | int | wlist_max_length
| ) |  |

static

Load data for one city.

Definition at line 3747 of file savegame2.c.

Referenced by sg_load_player_cities().

## ◆ sg_load_player_city_citizens()

static void sg_load_player_city_citizens | ( | struct loaddata * | loading,
|  | struct player * | plr,
|  | struct city * | pcity,
|  | const char * | citystr
| ) |  |

static

Load nationality data for one city.

Definition at line 4031 of file savegame2.c.

Referenced by sg_load_player_cities().

## ◆ sg_load_player_main()

static void sg_load_player_main | ( | struct loaddata * | loading,
|  | struct player * | plr
| ) |  |

static

Main player data loading function

Definition at line 3125 of file savegame2.c.

Referenced by sg_load_players().

## ◆ sg_load_player_unit()

static bool sg_load_player_unit | ( | struct loaddata * | loading,
|  | struct player * | plr,
|  | struct unit * | punit,
|  | const char * | unitstr
| ) |  |

static

Load one unit.

Definition at line 4198 of file savegame2.c.

Referenced by sg_load_player_units().

## ◆ sg_load_player_units()

static void sg_load_player_units | ( | struct loaddata * | loading,
|  | struct player * | plr
| ) |  |

static

Load unit data

Definition at line 4079 of file savegame2.c.

Referenced by sg_load_players().

## ◆ sg_load_player_units_transport()

static void sg_load_player_units_transport | ( | struct loaddata * | loading,
|  | struct player * | plr
| ) |  |

static

Load the transport status of all units. This is separated from the other code as all units must be known.

Definition at line 4791 of file savegame2.c.

Referenced by sg_load_players().

## ◆ sg_load_player_vision()

static void sg_load_player_vision | ( | struct loaddata * | loading,
|  | struct player * | plr
| ) |  |

static

Load vision data

Definition at line 4924 of file savegame2.c.

Referenced by sg_load_players().

## ◆ sg_load_player_vision_city()

static bool sg_load_player_vision_city | ( | struct loaddata * | loading,
|  | struct player * | plr,
|  | struct vision_site * | pdcity,
|  | const char * | citystr
| ) |  |

static

Load data for one seen city.

Definition at line 5145 of file savegame2.c.

Referenced by sg_load_player_vision().

## ◆ sg_load_players()

static void sg_load_players | ( | struct loaddata * | loading | ) |

static

Load '[player]'.

Definition at line 2933 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_players_basic()

static void sg_load_players_basic | ( | struct loaddata * | loading | ) |

static

Load '[player]' (basic data).

Definition at line 2676 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_random()

static void sg_load_random | ( | struct loaddata * | loading | ) |

static

Load '[random]'.

Definition at line 1981 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_researches()

static void sg_load_researches | ( | struct loaddata * | loading | ) |

static

Load '[research]'.

Definition at line 5252 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_ruledata()

static void sg_load_ruledata | ( | struct loaddata * | loading | ) |

static

Load '[ruledata]'.

Definition at line 1814 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_ruleset()

static void sg_load_ruleset | ( | struct loaddata * | loading | ) |

static

Set up correct ruleset for the savegame

Definition at line 1394 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_sanitycheck()

static void sg_load_sanitycheck | ( | struct loaddata * | loading | ) |

static

Sanity check for loaded game.

Definition at line 5518 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_savefile()

static void sg_load_savefile | ( | struct loaddata * | loading | ) |

static

Load '[savefile]'.

Definition at line 1428 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_scenario()

static void sg_load_scenario | ( | struct loaddata * | loading | ) |

static

Load '[scenario]'.

Definition at line 2055 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_script()

static void sg_load_script | ( | struct loaddata * | loading | ) |

static

Load '[script]'.

Definition at line 2040 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_settings()

static void sg_load_settings | ( | struct loaddata * | loading | ) |

static

Load '[settings]'.

Definition at line 2150 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_load_treaties()

static void sg_load_treaties | ( | struct loaddata * | loading | ) |

static

Load '[treaty_xxx]'.

Definition at line 5362 of file savegame2.c.

Referenced by savegame2_load().

## ◆ sg_order_to_action()

static int sg_order_to_action | ( | int | order,
|  | struct unit * | act_unit,
|  | struct tile * | tgt_tile
| ) |  |

static

Returns the action id corresponding to the specified order id. If no corresponding action is found ACTION_NONE is returned.

Relevant tile content information must be loaded before this function is called. Tile content information is relevant if it determines what action an old order result in. Example: a 2.6 ORDER_BUILD_CITY would result in Join City inside a domestic city and in Found City on a tile without a city. That makes domestic cities relevant tile content information.

Definition at line 4157 of file savegame2.c.

Referenced by sg_load_player_unit().

## ◆ sg_roads_set_bv()

static void sg_roads_set_bv | ( | bv_extras * | extras,
|  | char | ch,
|  | struct road_type ** | idx
| ) |  |

static

Helper function for loading roads from a savegame.

'ch' gives the character loaded from the savegame. Roads are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> road bit.

Definition at line 1289 of file savegame2.c.

Referenced by sg_load_map_tiles_roads().

## ◆ sg_roads_set_dbv()

static void sg_roads_set_dbv | ( | struct dbv * | extras,
|  | char | ch,
|  | struct road_type ** | idx
| ) |  |

static

Helper function for loading roads from a savegame.

'ch' gives the character loaded from the savegame. Roads are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> road bit.

Definition at line 1258 of file savegame2.c.

Referenced by sg_load_player_vision().

## ◆ sg_special_set_bv()

static void sg_special_set_bv | ( | struct tile * | ptile,
|  | bv_extras * | extras,
|  | char | ch,
|  | const enum tile_special_type * | idx,
|  | bool | rivers_overlay
| ) |  |

static

Complicated helper function for loading specials from a savegame.

'ch' gives the character loaded from the savegame. Specials are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> special bit. S_LAST is used to mark unused savegame bits.

Definition at line 1058 of file savegame2.c.

Referenced by sg_load_map_tiles_specials().

## ◆ sg_special_set_dbv()

static void sg_special_set_dbv | ( | struct tile * | ptile,
|  | struct dbv * | extras,
|  | char | ch,
|  | const enum tile_special_type * | idx,
|  | bool | rivers_overlay
| ) |  |

static

Complicated helper function for loading specials from a savegame.

'ch' gives the character loaded from the savegame. Specials are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> special bit. S_LAST is used to mark unused savegame bits.

Definition at line 921 of file savegame2.c.

Referenced by sg_load_player_vision().

## ◆ technology_load()

static Tech_type_id technology_load | ( | struct section_file * | file,
|  | const char * | path,
|  | int | plrno
| ) |  |

static

Load technology from path_name and if doesn't exist (because savegame is too old) load from path.

Definition at line 1354 of file savegame2.c.

Referenced by sg_load_researches().

## ◆ unit_ordering_apply()

static void unit_ordering_apply | ( | void |  | ) |

static

For each city and tile, sort unit lists according to ord_city and ord_map values.

Definition at line 834 of file savegame2.c.

Referenced by sg_load_players().

## ◆ unquote_block()

static int unquote_block | ( | const char *const | quoted_,
|  | void * | dest,
|  | int | dest_length
| ) |  |

static

Unquote a string. The unquoted data is written into dest. If the unquoted data will be larger than dest_length the function aborts. It returns the actual length of the unquoted block.

Definition at line 740 of file savegame2.c.

Referenced by sg_load_player_attributes().

## ◆ worklist_load()

static void worklist_load | ( | struct section_file * | file,
|  | int | wlist_max_length,
|  | struct worklist * | pwl,
|  | const char * | path,
|  |  | ...
| ) |  |

static

Load the worklist elements specified by path to the worklist pointed to by 'pwl'. 'pwl' should be a pointer to an existing worklist.

Definition at line 788 of file savegame2.c.

Referenced by sg_load_player_city().

## Variable Documentation

## ◆ sg_success

bool sg_success

extern

Definition at line 34 of file savecompat.c.

Referenced by savegame2_load().