Freeciv-3.1: /fast/freeciv/nightly/S3_1/common/game.c Source File

Freeciv-3.1

Loading...
Searching...
No Matches
game.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "fcintl.h"
20#include "ioz.h"
21#include "log.h"
22#include "mem.h"
23#include "shared.h"
24#include "support.h"
25
26/* aicore */
27#include "cm.h"
28
29/* common */
30#include "ai.h"
31#include "achievements.h"
32#include "actions.h"
33#include "city.h"
34#include "connection.h"
35#include "disaster.h"
36#include "extras.h"
37#include "government.h"
38#include "idex.h"
39#include "map.h"
40#include "multipliers.h"
41#include "nation.h"
42#include "packets.h"
43#include "player.h"
44#include "research.h"
45#include "spaceship.h"
46#include "specialist.h"
47#include "style.h"
48#include "tech.h"
49#include "terrain.h"
50#include "traderoutes.h"
51#include "unit.h"
52#include "unitlist.h"
53#include "victory.h"
54
55#include "game.h"
56
57 struct civ_game game;
58 struct world wld;
59
60 bool am_i_server = FALSE;
61
62 bool _ruleset_compat_mode = FALSE;
63
64static void game_defaults(bool keep_ruleset_value);
65
66/**********************************************************************/
69 int civ_population(const struct player *pplayer)
70{
71 int ppl = 0;
72
73 city_list_iterate(pplayer->cities, pcity) {
74 ppl += city_population(pcity);
75 } city_list_iterate_end;
76
77 return ppl;
78}
79
80/**********************************************************************/
83 struct city *game_city_by_name(const char *name)
84{
85 players_iterate(pplayer) {
86 struct city *pcity = city_list_find_name(pplayer->cities, name);
87
88 if (pcity) {
89 return pcity;
90 }
91 } players_iterate_end;
92
93 return NULL;
94}
95
96
97/**********************************************************************/
102 struct city *game_city_by_number(int id)
103{
104 return idex_lookup_city(&wld, id);
105}
106
107/**********************************************************************/
111 struct unit *game_unit_by_number(int id)
112{
113 return idex_lookup_unit(&wld, id);
114}
115
116/**********************************************************************/
119 void game_remove_unit(struct world *gworld, struct unit *punit)
120{
121 struct city *pcity;
122
123 /* It's possible that during city transfer homecity/unit owner
124 * information is inconsistent, and client then tries to remove
125 * now unseen unit so that homecity is not in the list of cities
126 * of the player (seemingly) owning the unit.
127 * Thus cannot use player_city_by_number() here, but have to
128 * consider cities of all players. */
129 pcity = game_city_by_number(punit->homecity);
130 if (pcity) {
131 unit_list_remove(pcity->units_supported, punit);
132
133 log_debug("game_remove_unit()"
134 " at (%d,%d) unit %d, %s %s home (%d,%d) city %d, %s %s",
135 TILE_XY(unit_tile(punit)),
136 punit->id,
137 nation_rule_name(nation_of_unit(punit)),
138 unit_rule_name(punit),
139 TILE_XY(pcity->tile),
140 punit->homecity,
141 nation_rule_name(nation_of_city(pcity)),
142 city_name_get(pcity));
143 } else if (IDENTITY_NUMBER_ZERO == punit->homecity) {
144 log_debug("game_remove_unit() at (%d,%d) unit %d, %s %s home %d",
145 TILE_XY(unit_tile(punit)),
146 punit->id,
147 nation_rule_name(nation_of_unit(punit)),
148 unit_rule_name(punit),
149 punit->homecity);
150 } else {
151 log_error("game_remove_unit() at (%d,%d) unit %d, %s %s home %d invalid",
152 TILE_XY(unit_tile(punit)),
153 punit->id,
154 nation_rule_name(nation_of_unit(punit)),
155 unit_rule_name(punit),
156 punit->homecity);
157 }
158
159 unit_list_remove(unit_tile(punit)->units, punit);
160 unit_list_remove(unit_owner(punit)->units, punit);
161
162 idex_unregister_unit(gworld, punit);
163
164 if (game.callbacks.unit_deallocate) {
165 (game.callbacks.unit_deallocate)(punit->id);
166 }
167 unit_virtual_destroy(punit);
168}
169
170/**********************************************************************/
173 void game_remove_city(struct world *gworld, struct city *pcity)
174{
175 struct tile *pcenter = city_tile(pcity);
176 struct player *powner = city_owner(pcity);
177 const struct civ_map *nmap = &(wld.map);
178
179 if (NULL != powner) {
180 /* Always unlink before clearing data */
181 city_list_remove(powner->cities, pcity);
182 }
183
184 if (NULL == pcenter) {
185 log_debug("game_remove_city() virtual city %d, %s",
186 pcity->id,
187 city_name_get(pcity));
188 } else {
189 log_debug("game_remove_city() at (%d,%d) city %d, %s %s",
190 TILE_XY(pcenter),
191 pcity->id,
192 nation_rule_name(nation_of_player(powner)),
193 city_name_get(pcity));
194
195 city_tile_iterate(nmap, city_map_radius_sq_get(pcity), pcenter, ptile) {
196 if (tile_worked(ptile) == pcity) {
197 tile_set_worked(ptile, NULL);
198 }
199 } city_tile_iterate_end;
200 }
201
202 idex_unregister_city(gworld, pcity);
203 destroy_city_virtual(pcity);
204}
205
206/**********************************************************************/
209 static void game_defaults(bool keep_ruleset_value)
210{
211 int i;
212
213 /* The control packet. */
214 game.control.government_count = 0;
215 game.control.nation_count = 0;
216 game.control.num_base_types = 0;
217 game.control.num_road_types = 0;
218 game.control.num_resource_types = 0;
219 game.control.num_impr_types = 0;
220 game.control.num_specialist_types = 0;
221 game.control.num_tech_types = 0;
222 game.control.num_unit_classes = 0;
223 game.control.num_unit_types = 0;
224 game.control.num_disaster_types = 0;
225 game.control.num_achievement_types = 0;
226 game.control.num_styles = 0;
227 game.control.num_music_styles = 0;
228 game.control.num_nation_groups = 0;
229 game.control.num_nation_sets = 0;
230 game.control.preferred_tileset[0] = '\0';
231 game.control.preferred_soundset[0] = '\0';
232 game.control.preferred_musicset[0] = '\0';
233 game.control.styles_count = 0;
234 game.control.terrain_count = 0;
235
236 game.ruleset_summary = NULL;
237 game.ruleset_description = NULL;
238 game.ruleset_capabilities = NULL;
239
240 /* The info packet. */
241 game.info.aifill = GAME_DEFAULT_AIFILL;
242 game.info.airlifting_style = GAME_DEFAULT_AIRLIFTINGSTYLE;
243 game.info.angrycitizen = GAME_DEFAULT_ANGRYCITIZEN;
244 game.info.borders = GAME_DEFAULT_BORDERS;
245 game.calendar.calendar_skip_0 = FALSE;
246 game.info.caravan_bonus_style = GAME_DEFAULT_CARAVAN_BONUS_STYLE;
247 game.info.celebratesize = GAME_DEFAULT_CELEBRATESIZE;
248 game.info.citymindist = GAME_DEFAULT_CITYMINDIST;
249 game.info.cooling = 0;
250 game.info.coolinglevel = 0; /* set later */
251 game.info.diplomacy = GAME_DEFAULT_DIPLOMACY;
252 game.info.fogofwar = GAME_DEFAULT_FOGOFWAR;
253 game.info.foodbox = GAME_DEFAULT_FOODBOX;
254 game.info.fulltradesize = GAME_DEFAULT_FULLTRADESIZE;
255 game.info.global_advance_count = 0;
256 for (i = 0; i < A_LAST; i++) {
257 /* game.num_tech_types = 0 here */
258 game.info.global_advances[i] = FALSE;
259 }
260 for (i = 0; i < B_LAST; i++) {
261 /* game.num_impr_types = 0 here */
262 game.info.great_wonder_owners[i] = WONDER_NOT_OWNED;
263 }
264 game.info.globalwarming = 0;
265 game.info.global_warming = GAME_DEFAULT_GLOBAL_WARMING;
266 game.info.gold = GAME_DEFAULT_GOLD;
267 game.info.infrapoints = GAME_DEFAULT_INFRA;
268 game.info.revolentype = GAME_DEFAULT_REVOLENTYPE;
269 game.info.default_government_id = G_LAST;
270 game.info.government_during_revolution_id = G_LAST;
271 game.info.happyborders = GAME_DEFAULT_HAPPYBORDERS;
272 game.info.heating = 0;
273 game.info.is_edit_mode = FALSE;
274 game.info.is_new_game = TRUE;
275 game.info.killstack = GAME_DEFAULT_KILLSTACK;
276 game.info.killcitizen = GAME_DEFAULT_KILLCITIZEN;
277 game.calendar.negative_year_label[0] = '\0';
278 game.info.notradesize = GAME_DEFAULT_NOTRADESIZE;
279 game.info.nuclearwinter = 0;
280 game.info.nuclear_winter = GAME_DEFAULT_NUCLEAR_WINTER;
281 game.calendar.positive_year_label[0] = '\0';
282 game.info.rapturedelay = GAME_DEFAULT_RAPTUREDELAY;
283 game.info.disasters = GAME_DEFAULT_DISASTERS;
284 game.info.restrictinfra = GAME_DEFAULT_RESTRICTINFRA;
285 game.info.sciencebox = GAME_DEFAULT_SCIENCEBOX;
286 game.info.shieldbox = GAME_DEFAULT_SHIELDBOX;
287 game.info.skill_level = GAME_DEFAULT_SKILL_LEVEL;
288 game.info.victory_conditions = GAME_DEFAULT_VICTORY_CONDITIONS;
289 game.info.team_pooled_research = GAME_DEFAULT_TEAM_POOLED_RESEARCH;
290 game.info.tech = GAME_DEFAULT_TECHLEVEL;
291 game.info.timeout = GAME_DEFAULT_TIMEOUT;
292 game.info.trademindist = GAME_DEFAULT_TRADEMINDIST;
293 game.info.trade_revenue_style = GAME_DEFAULT_TRADE_REVENUE_STYLE;
294 game.info.trading_city = GAME_DEFAULT_TRADING_CITY;
295 game.info.trading_gold = GAME_DEFAULT_TRADING_GOLD;
296 game.info.trading_tech = GAME_DEFAULT_TRADING_TECH;
297 game.info.turn = 0;
298 game.info.warminglevel = 0; /* set later */
299 game.info.year_0_hack = FALSE;
300 game.info.year = GAME_DEFAULT_START_YEAR;
301 BV_CLR_ALL(game.info.diplchance_initial_odds);
302
303 /* The scenario packets. */
304 game.scenario.is_scenario = FALSE;
305 game.scenario.name[0] = '\0';
306 game.scenario.authors[0] = '\0';
307 game.scenario.players = TRUE;
308 game.scenario.startpos_nations = FALSE;
309 game.scenario.handmade = FALSE;
310 game.scenario.prevent_new_cities = FALSE;
311 game.scenario.lake_flooding = TRUE;
312 game.scenario.have_resources = TRUE;
313 game.scenario.ruleset_locked = TRUE;
314 game.scenario.save_random = FALSE;
315 game.scenario.allow_ai_type_fallback = FALSE;
316
317 game.scenario_desc.description[0] = '\0';
318
319 /* Veteran system. */
320 game.veteran = NULL;
321
322 /* player colors */
323 game.plr_bg_color = NULL;
324
325 if (is_server()) {
326 /* All settings only used by the server (./server/ and ./ai/ */
327 sz_strlcpy(game.server.allow_take, GAME_DEFAULT_ALLOW_TAKE);
328 game.server.allowed_city_names = GAME_DEFAULT_ALLOWED_CITY_NAMES;
329 game.server.aqueductloss = GAME_DEFAULT_AQUEDUCTLOSS;
330 game.server.auto_ai_toggle = GAME_DEFAULT_AUTO_AI_TOGGLE;
331 game.server.autoattack = GAME_DEFAULT_AUTOATTACK;
332 game.server.barbarianrate = GAME_DEFAULT_BARBARIANRATE;
333 game.server.civilwarsize = GAME_DEFAULT_CIVILWARSIZE;
334 game.server.connectmsg[0] = '\0';
335 game.server.conquercost = GAME_DEFAULT_CONQUERCOST;
336 game.server.contactturns = GAME_DEFAULT_CONTACTTURNS;
337 for (i = 0; i < DEBUG_LAST; i++) {
338 game.server.debug[i] = FALSE;
339 }
340 sz_strlcpy(game.server.demography, GAME_DEFAULT_DEMOGRAPHY);
341 game.server.diplchance = GAME_DEFAULT_DIPLCHANCE;
342 game.server.diplbulbcost = GAME_DEFAULT_DIPLBULBCOST;
343 game.server.diplgoldcost = GAME_DEFAULT_DIPLGOLDCOST;
344 game.server.incite_gold_loss_chance = GAME_DEFAULT_INCITE_GOLD_LOSS_CHANCE;
345 game.server.incite_gold_capt_chance = GAME_DEFAULT_INCITE_GOLD_CAPT_CHANCE;
346 game.server.dispersion = GAME_DEFAULT_DISPERSION;
347 game.server.endspaceship = GAME_DEFAULT_END_SPACESHIP;
348 game.server.end_turn = GAME_DEFAULT_END_TURN;
349 game.server.event_cache.chat = GAME_DEFAULT_EVENT_CACHE_CHAT;
350 game.server.event_cache.info = GAME_DEFAULT_EVENT_CACHE_INFO;
351 game.server.event_cache.max_size = GAME_DEFAULT_EVENT_CACHE_MAX_SIZE;
352 game.server.event_cache.turns = GAME_DEFAULT_EVENT_CACHE_TURNS;
353 game.server.foggedborders = GAME_DEFAULT_FOGGEDBORDERS;
354 game.server.fogofwar_old = game.info.fogofwar;
355 game.server.last_updated_year = FALSE;
356 game.server.freecost = GAME_DEFAULT_FREECOST;
357 game.server.global_warming_percent = GAME_DEFAULT_GLOBAL_WARMING_PERCENT;
358 game.server.homecaughtunits = GAME_DEFAULT_HOMECAUGHTUNITS;
359 game.server.kick_time = GAME_DEFAULT_KICK_TIME;
360 game.server.killunhomed = GAME_DEFAULT_KILLUNHOMED;
361 game.server.maxconnectionsperhost = GAME_DEFAULT_MAXCONNECTIONSPERHOST;
362 game.server.last_ping = 0;
363 game.server.max_players = GAME_DEFAULT_MAX_PLAYERS;
364 game.server.meta_info.user_message[0] = '\0';
365 /* Do not clear meta_info.type here as it's already set to correct value */
366 game.server.mgr_distance = GAME_DEFAULT_MGR_DISTANCE;
367 game.server.mgr_foodneeded = GAME_DEFAULT_MGR_FOODNEEDED;
368 game.server.mgr_nationchance = GAME_DEFAULT_MGR_NATIONCHANCE;
369 game.server.mgr_turninterval = GAME_DEFAULT_MGR_TURNINTERVAL;
370 game.server.mgr_worldchance = GAME_DEFAULT_MGR_WORLDCHANCE;
371 game.server.multiresearch = GAME_DEFAULT_MULTIRESEARCH;
372 game.server.migration = GAME_DEFAULT_MIGRATION;
373 game.server.trait_dist = GAME_DEFAULT_TRAIT_DIST_MODE;
374 game.server.min_players = GAME_DEFAULT_MIN_PLAYERS;
375 game.server.natural_city_names = GAME_DEFAULT_NATURALCITYNAMES;
376 game.server.nuclear_winter_percent = GAME_DEFAULT_NUCLEAR_WINTER_PERCENT;
377 game.server.plrcolormode = GAME_DEFAULT_PLRCOLORMODE;
378 game.server.netwait = GAME_DEFAULT_NETWAIT;
379 game.server.occupychance = GAME_DEFAULT_OCCUPYCHANCE;
380 game.server.onsetbarbarian = GAME_DEFAULT_ONSETBARBARIAN;
381 game.server.additional_phase_seconds = 0;
382 game.server.phase_mode_stored = GAME_DEFAULT_PHASE_MODE;
383 game.server.pingtime = GAME_DEFAULT_PINGTIME;
384 game.server.pingtimeout = GAME_DEFAULT_PINGTIMEOUT;
385 game.server.razechance = GAME_DEFAULT_RAZECHANCE;
386 game.server.revealmap = GAME_DEFAULT_REVEALMAP;
387 game.server.revolution_length = GAME_DEFAULT_REVOLUTION_LENGTH;
388 if (!keep_ruleset_value) {
389 sz_strlcpy(game.server.rulesetdir, GAME_DEFAULT_RULESETDIR);
390 }
391 game.server.save_compress_level = GAME_DEFAULT_COMPRESS_LEVEL;
392 game.server.save_compress_type = GAME_DEFAULT_COMPRESS_TYPE;
393 sz_strlcpy(game.server.save_name, GAME_DEFAULT_SAVE_NAME);
394 game.server.save_nturns = GAME_DEFAULT_SAVETURNS;
395 game.server.save_options.save_known = TRUE;
396 game.server.save_options.save_private_map = TRUE;
397 game.server.save_options.save_starts = TRUE;
398 game.server.savepalace = GAME_DEFAULT_SAVEPALACE;
399 game.server.scorelog = GAME_DEFAULT_SCORELOG;
400 game.server.scoreloglevel = GAME_DEFAULT_SCORELOGLEVEL;
401 game.server.scoreturn = GAME_DEFAULT_SCORETURN - 1;
402 game.server.seed = GAME_DEFAULT_SEED;
403 sz_strlcpy(game.server.start_units, GAME_DEFAULT_START_UNITS);
404 game.server.spaceship_travel_time = GAME_DEFAULT_SPACESHIP_TRAVEL_TIME;
405 game.server.start_year = GAME_DEFAULT_START_YEAR;
406 game.server.tcptimeout = GAME_DEFAULT_TCPTIMEOUT;
407 game.server.techlost_donor = GAME_DEFAULT_TECHLOST_DONOR;
408 game.server.techlost_recv = GAME_DEFAULT_TECHLOST_RECV;
409 game.server.techpenalty = GAME_DEFAULT_TECHPENALTY;
410 game.server.timeoutaddenemymove = GAME_DEFAULT_TIMEOUTADDEMOVE;
411 game.server.timeoutcounter = GAME_DEFAULT_TIMEOUTCOUNTER;
412 game.server.timeoutinc = GAME_DEFAULT_TIMEOUTINC;
413 game.server.timeoutincmult = GAME_DEFAULT_TIMEOUTINCMULT;
414 game.server.timeoutint = GAME_DEFAULT_TIMEOUTINT;
415 game.server.timeoutintinc = GAME_DEFAULT_TIMEOUTINTINC;
416 game.server.turnblock = GAME_DEFAULT_TURNBLOCK;
417 game.server.unitwaittime = GAME_DEFAULT_UNITWAITTIME;
418 game.server.plr_colors = NULL;
419 } else {
420 /* Client side takes care of itself in client_main() */
421 }
422}
423
424/**********************************************************************/
429 void game_init(bool keep_ruleset_value)
430{
431 game_defaults(keep_ruleset_value);
432 player_slots_init();
433 map_init(&wld.map, is_server());
434 team_slots_init();
435 game_ruleset_init();
436 idex_init(&wld);
437 cm_init();
438 researches_init();
439 universal_found_functions_init();
440}
441
442/**********************************************************************/
446 void game_map_init(void)
447{
448 /* FIXME: it's not clear where these values should be initialized. It
449 * can't be done in game_init because the map isn't created yet. Maybe it
450 * should be done in the mapgen code or in the maphand code. It should
451 * surely be called when the map is generated. */
452 game.info.warminglevel = (map_num_tiles() + 499) / 500;
453 game.info.coolinglevel = (map_num_tiles() + 499) / 500;
454}
455
456/**********************************************************************/
459 void game_free(void)
460{
461 player_slots_free();
462 main_map_free();
463 free_city_map_index();
464 idex_free(&wld);
465 team_slots_free();
466 game_ruleset_free();
467 researches_free();
468 cm_free();
469}
470
471/**********************************************************************/
475 void game_reset(void)
476{
477 if (is_server()) {
478 game_free();
479 game_init(FALSE);
480 } else {
481 /* Reset the players infos. */
482 players_iterate(pplayer) {
483 player_clear(pplayer, FALSE);
484 } players_iterate_end;
485
486 main_map_free();
487 free_city_map_index();
488 idex_free(&wld);
489
490 map_init(&wld.map, FALSE);
491 idex_init(&wld);
492 researches_init();
493 }
494}
495
496/**********************************************************************/
499 void game_ruleset_init(void)
500{
501 nation_sets_groups_init();
502 ruleset_cache_init();
503 disaster_types_init();
504 achievements_init();
505 actions_init();
506 trade_route_types_init();
507 terrains_init();
508 extras_init();
509 goods_init();
510 improvements_init();
511 techs_init();
512 unit_classes_init();
513 unit_types_init();
514 specialists_init();
515 user_unit_class_flags_init();
516 user_unit_type_flags_init();
517 user_terrain_flags_init();
518 user_extra_flags_init();
519 tech_classes_init();
520 user_tech_flags_init();
521 multipliers_init();
522 clause_infos_init();
523
524 if (is_server()) {
525 game.server.luadata = NULL;
526 game.server.ruledit.nationlist = NULL;
527 game.server.ruledit.embedded_nations = NULL;
528 game.server.ruledit.embedded_nations_count = 0;
529 game.server.ruledit.allowed_govs = NULL;
530 game.server.ruledit.allowed_terrains = NULL;
531 game.server.ruledit.allowed_styles = NULL;
532 game.server.ruledit.nc_agovs = NULL;
533 game.server.ruledit.nc_aterrs = NULL;
534 game.server.ruledit.nc_astyles = NULL;
535 game.server.ruledit.ag_count = 0;
536 game.server.ruledit.at_count = 0;
537 game.server.ruledit.as_count = 0;
538 }
539}
540
541/**********************************************************************/
544 void game_ruleset_free(void)
545{
546 int i;
547
548 CALL_FUNC_EACH_AI(units_ruleset_close);
549
550 /* Clear main structures which can points to the ruleset dependent
551 * structures. */
552 players_iterate(pplayer) {
553 player_ruleset_close(pplayer);
554 } players_iterate_end;
555 game.government_during_revolution = NULL;
556
557 specialists_free();
558 unit_classes_free();
559 techs_free();
560 governments_free();
561 nations_free();
562 unit_types_free();
563 unit_type_flags_free();
564 unit_class_flags_free();
565 role_unit_precalcs_free();
566 improvements_free();
567 goods_free();
568 extras_free();
569 music_styles_free();
570 city_styles_free();
571 styles_free();
572 actions_free();
573 achievements_free();
574 disaster_types_free();
575 terrains_free();
576 user_tech_flags_free();
577 extra_flags_free();
578 user_terrain_flags_free();
579 ruleset_cache_free();
580 nation_sets_groups_free();
581 multipliers_free();
582 clause_infos_free();
583
584 /* Destroy the default veteran system. */
585 veteran_system_destroy(game.veteran);
586 game.veteran = NULL;
587
588 /* Player colors. */
589 if (game.plr_bg_color != NULL) {
590 rgbcolor_destroy(game.plr_bg_color);
591 game.plr_bg_color = NULL;
592 }
593
594 if (is_server()) {
595 if (game.server.luadata != NULL) {
596 secfile_destroy(game.server.luadata);
597 }
598 if (game.server.ruledit.description_file != NULL) {
599 free(game.server.ruledit.description_file);
600 game.server.ruledit.description_file = NULL;
601 }
602 if (game.server.ruledit.nationlist != NULL) {
603 free(game.server.ruledit.nationlist);
604 game.server.ruledit.nationlist = NULL;
605 }
606 if (game.server.ruledit.embedded_nations != NULL) {
607 for (i = 0; i < game.server.ruledit.embedded_nations_count; i++) {
608 free(game.server.ruledit.embedded_nations[i]);
609 }
610 free(game.server.ruledit.embedded_nations);
611 game.server.ruledit.embedded_nations = NULL;
612 game.server.ruledit.embedded_nations_count = 0;
613 if (game.server.ruledit.allowed_govs != NULL) {
614 for (i = 0; i < game.server.ruledit.ag_count; i++) {
615 free(game.server.ruledit.nc_agovs[i]);
616 }
617 free(game.server.ruledit.allowed_govs);
618 game.server.ruledit.allowed_govs = NULL;
619 game.server.ruledit.nc_agovs = NULL;
620 }
621 if (game.server.ruledit.allowed_terrains != NULL) {
622 for (i = 0; i < game.server.ruledit.at_count; i++) {
623 free(game.server.ruledit.nc_aterrs[i]);
624 }
625 free(game.server.ruledit.allowed_terrains);
626 game.server.ruledit.allowed_terrains = NULL;
627 game.server.ruledit.nc_aterrs = NULL;
628 }
629 if (game.server.ruledit.allowed_styles != NULL) {
630 for (i = 0; i < game.server.ruledit.as_count; i++) {
631 free(game.server.ruledit.nc_astyles[i]);
632 }
633 free(game.server.ruledit.allowed_styles);
634 game.server.ruledit.allowed_styles = NULL;
635 game.server.ruledit.nc_astyles = NULL;
636 }
637 }
638 }
639
640 for (i = 0; i < MAX_CALENDAR_FRAGMENTS; i++) {
641 game.calendar.calendar_fragment_name[i][0] = '\0';
642 }
643
644 if (game.ruleset_summary != NULL) {
645 free(game.ruleset_summary);
646 game.ruleset_summary = NULL;
647 }
648
649 if (game.ruleset_description != NULL) {
650 free(game.ruleset_description);
651 game.ruleset_description = NULL;
652 }
653
654 if (game.ruleset_capabilities != NULL) {
655 free(game.ruleset_capabilities);
656 game.ruleset_capabilities = NULL;
657 }
658}
659
660/**********************************************************************/
663 void initialize_globals(void)
664{
665 players_iterate(pplayer) {
666 city_list_iterate(pplayer->cities, pcity) {
667 city_built_iterate(pcity, pimprove) {
668 if (is_wonder(pimprove)) {
669 if (is_great_wonder(pimprove)) {
670 game.info.great_wonder_owners[improvement_index(pimprove)] =
671 player_number(pplayer);
672 }
673 pplayer->wonders[improvement_index(pimprove)] = pcity->id;
674 }
675 } city_built_iterate_end;
676 } city_list_iterate_end;
677 } players_iterate_end;
678}
679
680/**********************************************************************/
687 bool is_player_phase(const struct player *pplayer, int phase)
688{
689 switch (game.info.phase_mode) {
690 case PMT_CONCURRENT:
691 return TRUE;
692 break;
693 case PMT_PLAYERS_ALTERNATE:
694 return player_number(pplayer) == phase;
695 break;
696 case PMT_TEAMS_ALTERNATE:
697 fc_assert_ret_val(NULL != pplayer->team, FALSE);
698 return team_number(pplayer->team) == phase;
699 break;
700 default:
701 break;
702 }
703
704 fc_assert_msg(FALSE, "Unrecognized phase mode %d in is_player_phase().",
705 phase);
706 return TRUE;
707}
708
709/**********************************************************************/
714 const char *population_to_text(int thousand_citizen)
715{
716 /* big_int_to_text can't handle negative values, and in any case we'd
717 * better not have a negative population. */
718 fc_assert_ret_val(thousand_citizen >= 0, NULL);
719 return big_int_to_text(thousand_citizen, game.info.pop_report_zeroes - 1);
720}
721
722/**********************************************************************/
725 static char *year_suffix(void)
726{
727 static char buf[MAX_LEN_NAME];
728 const char *suffix;
729 char safe_year_suffix[MAX_LEN_NAME];
730 const char *max = safe_year_suffix + MAX_LEN_NAME - 1;
731 char *c = safe_year_suffix;
732
733 if (game.info.year < 0) {
734 suffix = game.calendar.negative_year_label;
735 } else {
736 suffix = game.calendar.positive_year_label;
737 }
738
739 /* Remove all non alphanumeric characters from the year suffix. */
740 for (; '\0' != *suffix && c < max; suffix++) {
741 if (fc_isalnum(*suffix)) {
742 *c++ = *suffix;
743 }
744 }
745 *c = '\0';
746
747 fc_snprintf(buf, sizeof(buf), "%s", safe_year_suffix);
748
749 return buf;
750}
751
752/**********************************************************************/
771 int generate_save_name(const char *format, char *buf, int buflen,
772 const char *reason)
773{
774 struct cf_sequence sequences[5] = {
775 cf_str_seq('R', (reason == NULL) ? "auto" : reason),
776 cf_str_seq('S', year_suffix()),
777 { 0 }, { 0 }, /* Works for both gcc and tcc */
778 cf_end()
779 };
780
781 cf_int_seq('T', game.info.turn, &sequences[2]);
782 cf_int_seq('Y', game.info.year, &sequences[3]);
783
784 fc_vsnprintcf(buf, buflen, format, sequences, -1);
785
786 if (0 == strcmp(format, buf)) {
787 /* Use the default savename if 'format' does not contain
788 * printf information. */
789 char savename[512];
790
791 fc_snprintf(savename, sizeof(savename), "%s-T%%04T-Y%%05Y-%%R",
792 format);
793 fc_vsnprintcf(buf, buflen, savename, sequences, -1);
794 }
795
796 log_debug("save name generated from '%s': %s", format, buf);
797
798 return strlen(buf);
799}
800
801/**********************************************************************/
804 void user_flag_init(struct user_flag *flag)
805{
806 flag->name = NULL;
807 flag->helptxt = NULL;
808}
809
810/**********************************************************************/
813 void user_flag_free(struct user_flag *flag)
814{
815 if (flag->name != NULL) {
816 FC_FREE(flag->name);
817 flag->name = NULL;
818 }
819 if (flag->helptxt != NULL) {
820 FC_FREE(flag->helptxt);
821 flag->helptxt = NULL;
822 }
823}
824
825/**********************************************************************/
828 int current_turn_timeout(void)
829{
830 if (game.info.turn == 1 && game.info.first_timeout != -1) {
831 return game.info.first_timeout;
832 } else {
833 return game.info.timeout;
834 }
835}
achievements_free
void achievements_free(void)
Definition achievements.c:59
achievements_init
void achievements_init(void)
Definition achievements.c:40
achievements.h
actions_free
void actions_free(void)
Definition actions.c:1530
actions_init
void actions_init(void)
Definition actions.c:1460
actions.h
ai.h
CALL_FUNC_EACH_AI
#define CALL_FUNC_EACH_AI(_func,...)
Definition ai.h:384
BV_CLR_ALL
#define BV_CLR_ALL(bv)
Definition bitvector.h:95
city_styles_free
void city_styles_free(void)
Definition city.c:3320
city_name_get
const char * city_name_get(const struct city *pcity)
Definition city.c:1111
city_population
int city_population(const struct city *pcity)
Definition city.c:1165
free_city_map_index
void free_city_map_index(void)
Definition city.c:604
city_map_radius_sq_get
int city_map_radius_sq_get(const struct city *pcity)
Definition city.c:132
destroy_city_virtual
void destroy_city_virtual(struct city *pcity)
Definition city.c:3415
city_list_find_name
struct city * city_list_find_name(struct city_list *This, const char *name)
Definition city.c:1664
city.h
city_list_iterate
#define city_list_iterate(citylist, pcity)
Definition city.h:488
city_tile
#define city_tile(_pcity_)
Definition city.h:544
city_owner
#define city_owner(_pcity_)
Definition city.h:543
city_list_iterate_end
#define city_list_iterate_end
Definition city.h:490
city_tile_iterate
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
Definition city.h:222
city_tile_iterate_end
#define city_tile_iterate_end
Definition city.h:230
city_built_iterate
#define city_built_iterate(_pcity, _p)
Definition city.h:801
city_built_iterate_end
#define city_built_iterate_end
Definition city.h:807
cm_init
void cm_init(void)
Definition cm.c:293
cm_free
void cm_free(void)
Definition cm.c:328
cm.h
connection.h
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 * punit
Definition dialogs_g.h:73
clause_infos_init
void clause_infos_init(void)
Definition diptreaty.c:245
clause_infos_free
void clause_infos_free(void)
Definition diptreaty.c:260
disaster_types_init
void disaster_types_init(void)
Definition disaster.c:33
disaster_types_free
void disaster_types_free(void)
Definition disaster.c:46
disaster.h
ruleset_cache_free
void ruleset_cache_free(void)
Definition effects.c:271
ruleset_cache_init
void ruleset_cache_init(void)
Definition effects.c:245
user_extra_flags_init
void user_extra_flags_init(void)
Definition extras.c:858
extras_free
void extras_free(void)
Definition extras.c:80
extra_flags_free
void extra_flags_free(void)
Definition extras.c:870
extras_init
void extras_init(void)
Definition extras.c:43
extras.h
is_server
static bool is_server(void)
Definition fc_interface.h:69
MAX_CALENDAR_FRAGMENTS
#define MAX_CALENDAR_FRAGMENTS
Definition fc_types.h:62
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
IDENTITY_NUMBER_ZERO
#define IDENTITY_NUMBER_ZERO
Definition fc_types.h:82
fcintl.h
population_to_text
const char * population_to_text(int thousand_citizen)
Definition game.c:714
game_reset
void game_reset(void)
Definition game.c:475
user_flag_init
void user_flag_init(struct user_flag *flag)
Definition game.c:804
user_flag_free
void user_flag_free(struct user_flag *flag)
Definition game.c:813
game
struct civ_game game
Definition game.c:57
game_ruleset_init
void game_ruleset_init(void)
Definition game.c:499
is_player_phase
bool is_player_phase(const struct player *pplayer, int phase)
Definition game.c:687
game_defaults
static void game_defaults(bool keep_ruleset_value)
Definition game.c:209
year_suffix
static char * year_suffix(void)
Definition game.c:725
current_turn_timeout
int current_turn_timeout(void)
Definition game.c:828
game_city_by_name
struct city * game_city_by_name(const char *name)
Definition game.c:83
game_ruleset_free
void game_ruleset_free(void)
Definition game.c:544
game_init
void game_init(bool keep_ruleset_value)
Definition game.c:429
wld
struct world wld
Definition game.c:58
_ruleset_compat_mode
bool _ruleset_compat_mode
Definition game.c:62
game_remove_unit
void game_remove_unit(struct world *gworld, struct unit *punit)
Definition game.c:119
game_unit_by_number
struct unit * game_unit_by_number(int id)
Definition game.c:111
civ_population
int civ_population(const struct player *pplayer)
Definition game.c:69
game_remove_city
void game_remove_city(struct world *gworld, struct city *pcity)
Definition game.c:173
game_free
void game_free(void)
Definition game.c:459
game_map_init
void game_map_init(void)
Definition game.c:446
initialize_globals
void initialize_globals(void)
Definition game.c:663
generate_save_name
int generate_save_name(const char *format, char *buf, int buflen, const char *reason)
Definition game.c:771
am_i_server
bool am_i_server
Definition game.c:60
game_city_by_number
struct city * game_city_by_number(int id)
Definition game.c:102
game.h
GAME_DEFAULT_TECHPENALTY
#define GAME_DEFAULT_TECHPENALTY
Definition game.h:532
GAME_DEFAULT_SKILL_LEVEL
#define GAME_DEFAULT_SKILL_LEVEL
Definition game.h:675
GAME_DEFAULT_KILLSTACK
#define GAME_DEFAULT_KILLSTACK
Definition game.h:525
GAME_DEFAULT_INFRA
#define GAME_DEFAULT_INFRA
Definition game.h:356
GAME_DEFAULT_REVOLENTYPE
#define GAME_DEFAULT_REVOLENTYPE
Definition game.h:710
GAME_DEFAULT_AUTO_AI_TOGGLE
#define GAME_DEFAULT_AUTO_AI_TOGGLE
Definition game.h:571
GAME_DEFAULT_CARAVAN_BONUS_STYLE
#define GAME_DEFAULT_CARAVAN_BONUS_STYLE
Definition game.h:631
GAME_DEFAULT_TIMEOUTINTINC
#define GAME_DEFAULT_TIMEOUTINTINC
Definition game.h:576
GAME_DEFAULT_SCORETURN
#define GAME_DEFAULT_SCORETURN
Definition game.h:560
GAME_DEFAULT_TCPTIMEOUT
#define GAME_DEFAULT_TCPTIMEOUT
Definition game.h:597
GAME_DEFAULT_EVENT_CACHE_INFO
#define GAME_DEFAULT_EVENT_CACHE_INFO
Definition game.h:692
GAME_DEFAULT_MGR_FOODNEEDED
#define GAME_DEFAULT_MGR_FOODNEEDED
Definition game.h:504
GAME_DEFAULT_TECHLOST_DONOR
#define GAME_DEFAULT_TECHLOST_DONOR
Definition game.h:540
GAME_DEFAULT_TIMEOUTINT
#define GAME_DEFAULT_TIMEOUTINT
Definition game.h:575
GAME_DEFAULT_ALLOWED_CITY_NAMES
#define GAME_DEFAULT_ALLOWED_CITY_NAMES
Definition game.h:706
GAME_DEFAULT_SCORELOG
#define GAME_DEFAULT_SCORELOG
Definition game.h:553
GAME_DEFAULT_OCCUPYCHANCE
#define GAME_DEFAULT_OCCUPYCHANCE
Definition game.h:645
GAME_DEFAULT_GLOBAL_WARMING_PERCENT
#define GAME_DEFAULT_GLOBAL_WARMING_PERCENT
Definition game.h:425
GAME_DEFAULT_TRADING_TECH
#define GAME_DEFAULT_TRADING_TECH
Definition game.h:627
GAME_DEFAULT_SAVETURNS
#define GAME_DEFAULT_SAVETURNS
Definition game.h:658
GAME_DEFAULT_BORDERS
#define GAME_DEFAULT_BORDERS
Definition game.h:435
GAME_DEFAULT_AIRLIFTINGSTYLE
#define GAME_DEFAULT_AIRLIFTINGSTYLE
Definition game.h:717
GAME_DEFAULT_KILLUNHOMED
#define GAME_DEFAULT_KILLUNHOMED
Definition game.h:528
GAME_DEFAULT_SCIENCEBOX
#define GAME_DEFAULT_SCIENCEBOX
Definition game.h:399
GAME_DEFAULT_MGR_WORLDCHANCE
#define GAME_DEFAULT_MGR_WORLDCHANCE
Definition game.h:517
GAME_DEFAULT_ONSETBARBARIAN
#define GAME_DEFAULT_ONSETBARBARIAN
Definition game.h:641
GAME_DEFAULT_KILLCITIZEN
#define GAME_DEFAULT_KILLCITIZEN
Definition game.h:526
GAME_DEFAULT_SHIELDBOX
#define GAME_DEFAULT_SHIELDBOX
Definition game.h:395
DEBUG_LAST
@ DEBUG_LAST
Definition game.h:41
GAME_DEFAULT_MAXCONNECTIONSPERHOST
#define GAME_DEFAULT_MAXCONNECTIONSPERHOST
Definition game.h:582
GAME_DEFAULT_INCITE_GOLD_CAPT_CHANCE
#define GAME_DEFAULT_INCITE_GOLD_CAPT_CHANCE
Definition game.h:415
GAME_DEFAULT_DEMOGRAPHY
#define GAME_DEFAULT_DEMOGRAPHY
Definition game.h:679
GAME_DEFAULT_FULLTRADESIZE
#define GAME_DEFAULT_FULLTRADESIZE
Definition game.h:623
GAME_DEFAULT_TIMEOUTINCMULT
#define GAME_DEFAULT_TIMEOUTINCMULT
Definition game.h:578
GAME_DEFAULT_CELEBRATESIZE
#define GAME_DEFAULT_CELEBRATESIZE
Definition game.h:480
GAME_DEFAULT_RAPTUREDELAY
#define GAME_DEFAULT_RAPTUREDELAY
Definition game.h:482
GAME_DEFAULT_REVOLUTION_LENGTH
#define GAME_DEFAULT_REVOLUTION_LENGTH
Definition game.h:711
GAME_DEFAULT_MGR_TURNINTERVAL
#define GAME_DEFAULT_MGR_TURNINTERVAL
Definition game.h:500
GAME_DEFAULT_TIMEOUTINC
#define GAME_DEFAULT_TIMEOUTINC
Definition game.h:577
GAME_DEFAULT_START_UNITS
#define GAME_DEFAULT_START_UNITS
Definition game.h:360
GAME_DEFAULT_ALLOW_TAKE
#define GAME_DEFAULT_ALLOW_TAKE
Definition game.h:680
GAME_DEFAULT_MIN_PLAYERS
#define GAME_DEFAULT_MIN_PLAYERS
Definition game.h:377
GAME_DEFAULT_SPACESHIP_TRAVEL_TIME
#define GAME_DEFAULT_SPACESHIP_TRAVEL_TIME
Definition game.h:565
GAME_DEFAULT_RULESETDIR
#define GAME_DEFAULT_RULESETDIR
Definition game.h:654
GAME_DEFAULT_AUTOATTACK
#define GAME_DEFAULT_AUTOATTACK
Definition game.h:649
GAME_DEFAULT_REVEALMAP
#define GAME_DEFAULT_REVEALMAP
Definition game.h:551
GAME_DEFAULT_TEAM_POOLED_RESEARCH
#define GAME_DEFAULT_TEAM_POOLED_RESEARCH
Definition game.h:544
GAME_DEFAULT_SEED
#define GAME_DEFAULT_SEED
Definition game.h:348
GAME_DEFAULT_HOMECAUGHTUNITS
#define GAME_DEFAULT_HOMECAUGHTUNITS
Definition game.h:494
GAME_DEFAULT_NETWAIT
#define GAME_DEFAULT_NETWAIT
Definition game.h:601
GAME_DEFAULT_KICK_TIME
#define GAME_DEFAULT_KICK_TIME
Definition game.h:722
GAME_DEFAULT_PLRCOLORMODE
#define GAME_DEFAULT_PLRCOLORMODE
Definition game.h:708
GAME_DEFAULT_DIPLCHANCE
#define GAME_DEFAULT_DIPLCHANCE
Definition game.h:441
GAME_DEFAULT_RAZECHANCE
#define GAME_DEFAULT_RAZECHANCE
Definition game.h:547
GAME_DEFAULT_START_YEAR
#define GAME_DEFAULT_START_YEAR
Definition game.h:715
GAME_DEFAULT_INCITE_GOLD_LOSS_CHANCE
#define GAME_DEFAULT_INCITE_GOLD_LOSS_CHANCE
Definition game.h:411
GAME_DEFAULT_TIMEOUTCOUNTER
#define GAME_DEFAULT_TIMEOUTCOUNTER
Definition game.h:580
GAME_DEFAULT_TRADING_CITY
#define GAME_DEFAULT_TRADING_CITY
Definition game.h:629
GAME_DEFAULT_FOODBOX
#define GAME_DEFAULT_FOODBOX
Definition game.h:391
GAME_DEFAULT_COMPRESS_TYPE
#define GAME_DEFAULT_COMPRESS_TYPE
Definition game.h:703
GAME_DEFAULT_PINGTIMEOUT
#define GAME_DEFAULT_PINGTIMEOUT
Definition game.h:609
GAME_DEFAULT_TRADE_REVENUE_STYLE
#define GAME_DEFAULT_TRADE_REVENUE_STYLE
Definition game.h:637
GAME_DEFAULT_SAVEPALACE
#define GAME_DEFAULT_SAVEPALACE
Definition game.h:492
GAME_DEFAULT_GLOBAL_WARMING
#define GAME_DEFAULT_GLOBAL_WARMING
Definition game.h:423
GAME_DEFAULT_TECHLOST_RECV
#define GAME_DEFAULT_TECHLOST_RECV
Definition game.h:536
GAME_DEFAULT_NOTRADESIZE
#define GAME_DEFAULT_NOTRADESIZE
Definition game.h:615
GAME_DEFAULT_COMPRESS_LEVEL
#define GAME_DEFAULT_COMPRESS_LEVEL
Definition game.h:694
GAME_DEFAULT_NUCLEAR_WINTER_PERCENT
#define GAME_DEFAULT_NUCLEAR_WINTER_PERCENT
Definition game.h:431
GAME_DEFAULT_TRADING_GOLD
#define GAME_DEFAULT_TRADING_GOLD
Definition game.h:628
GAME_DEFAULT_TRAIT_DIST_MODE
#define GAME_DEFAULT_TRAIT_DIST_MODE
Definition game.h:490
GAME_DEFAULT_NUCLEAR_WINTER
#define GAME_DEFAULT_NUCLEAR_WINTER
Definition game.h:429
GAME_DEFAULT_FREECOST
#define GAME_DEFAULT_FREECOST
Definition game.h:445
GAME_DEFAULT_MAX_PLAYERS
#define GAME_DEFAULT_MAX_PLAYERS
Definition game.h:381
GAME_DEFAULT_CITYMINDIST
#define GAME_DEFAULT_CITYMINDIST
Definition game.h:465
GAME_DEFAULT_PHASE_MODE
#define GAME_DEFAULT_PHASE_MODE
Definition game.h:595
GAME_DEFAULT_AIFILL
#define GAME_DEFAULT_AIFILL
Definition game.h:385
GAME_DEFAULT_MULTIRESEARCH
#define GAME_DEFAULT_MULTIRESEARCH
Definition game.h:545
GAME_DEFAULT_CONQUERCOST
#define GAME_DEFAULT_CONQUERCOST
Definition game.h:449
GAME_DEFAULT_TIMEOUT
#define GAME_DEFAULT_TIMEOUT
Definition game.h:573
GAME_DEFAULT_CONTACTTURNS
#define GAME_DEFAULT_CONTACTTURNS
Definition game.h:476
GAME_DEFAULT_SCORELOGLEVEL
#define GAME_DEFAULT_SCORELOGLEVEL
Definition game.h:554
GAME_DEFAULT_TECHLEVEL
#define GAME_DEFAULT_TECHLEVEL
Definition game.h:367
GAME_DEFAULT_DISASTERS
#define GAME_DEFAULT_DISASTERS
Definition game.h:486
GAME_DEFAULT_GOLD
#define GAME_DEFAULT_GOLD
Definition game.h:352
GAME_DEFAULT_MIGRATION
#define GAME_DEFAULT_MIGRATION
Definition game.h:498
GAME_DEFAULT_NATURALCITYNAMES
#define GAME_DEFAULT_NATURALCITYNAMES
Definition game.h:496
GAME_DEFAULT_EVENT_CACHE_TURNS
#define GAME_DEFAULT_EVENT_CACHE_TURNS
Definition game.h:682
GAME_DEFAULT_VICTORY_CONDITIONS
#define GAME_DEFAULT_VICTORY_CONDITIONS
Definition game.h:562
GAME_DEFAULT_FOGGEDBORDERS
#define GAME_DEFAULT_FOGGEDBORDERS
Definition game.h:421
GAME_DEFAULT_UNITWAITTIME
#define GAME_DEFAULT_UNITWAITTIME
Definition game.h:593
GAME_DEFAULT_TIMEOUTADDEMOVE
#define GAME_DEFAULT_TIMEOUTADDEMOVE
Definition game.h:579
GAME_DEFAULT_DISPERSION
#define GAME_DEFAULT_DISPERSION
Definition game.h:363
GAME_DEFAULT_EVENT_CACHE_CHAT
#define GAME_DEFAULT_EVENT_CACHE_CHAT
Definition game.h:690
GAME_DEFAULT_DIPLOMACY
#define GAME_DEFAULT_DIPLOMACY
Definition game.h:439
GAME_DEFAULT_MGR_DISTANCE
#define GAME_DEFAULT_MGR_DISTANCE
Definition game.h:509
GAME_DEFAULT_TURNBLOCK
#define GAME_DEFAULT_TURNBLOCK
Definition game.h:569
GAME_DEFAULT_PINGTIME
#define GAME_DEFAULT_PINGTIME
Definition game.h:605
GAME_DEFAULT_AQUEDUCTLOSS
#define GAME_DEFAULT_AQUEDUCTLOSS
Definition game.h:521
GAME_DEFAULT_TRADEMINDIST
#define GAME_DEFAULT_TRADEMINDIST
Definition game.h:633
GAME_DEFAULT_ANGRYCITIZEN
#define GAME_DEFAULT_ANGRYCITIZEN
Definition game.h:371
GAME_DEFAULT_BARBARIANRATE
#define GAME_DEFAULT_BARBARIANRATE
Definition game.h:639
GAME_DEFAULT_HAPPYBORDERS
#define GAME_DEFAULT_HAPPYBORDERS
Definition game.h:437
GAME_DEFAULT_END_TURN
#define GAME_DEFAULT_END_TURN
Definition game.h:373
GAME_DEFAULT_DIPLGOLDCOST
#define GAME_DEFAULT_DIPLGOLDCOST
Definition game.h:407
GAME_DEFAULT_END_SPACESHIP
#define GAME_DEFAULT_END_SPACESHIP
Definition game.h:563
GAME_DEFAULT_EVENT_CACHE_MAX_SIZE
#define GAME_DEFAULT_EVENT_CACHE_MAX_SIZE
Definition game.h:686
GAME_DEFAULT_SAVE_NAME
#define GAME_DEFAULT_SAVE_NAME
Definition game.h:657
GAME_DEFAULT_MGR_NATIONCHANCE
#define GAME_DEFAULT_MGR_NATIONCHANCE
Definition game.h:513
GAME_DEFAULT_FOGOFWAR
#define GAME_DEFAULT_FOGOFWAR
Definition game.h:419
GAME_DEFAULT_DIPLBULBCOST
#define GAME_DEFAULT_DIPLBULBCOST
Definition game.h:403
GAME_DEFAULT_RESTRICTINFRA
#define GAME_DEFAULT_RESTRICTINFRA
Definition game.h:473
GAME_DEFAULT_CIVILWARSIZE
#define GAME_DEFAULT_CIVILWARSIZE
Definition game.h:469
governments_free
void governments_free(void)
Definition government.c:543
government.h
G_LAST
#define G_LAST
Definition government.h:48
idex_free
void idex_free(struct world *iworld)
Definition idex.c:53
idex_lookup_city
struct city * idex_lookup_city(struct world *iworld, int id)
Definition idex.c:132
idex_unregister_city
void idex_unregister_city(struct world *iworld, struct city *pcity)
Definition idex.c:96
idex_init
void idex_init(struct world *iworld)
Definition idex.c:44
idex_lookup_unit
struct unit * idex_lookup_unit(struct world *iworld, int id)
Definition idex.c:145
idex_unregister_unit
void idex_unregister_unit(struct world *iworld, struct unit *punit)
Definition idex.c:114
idex.h
improvements_init
void improvements_init(void)
Definition improvement.c:46
improvement_index
Impr_type_id improvement_index(const struct impr_type *pimprove)
Definition improvement.c:173
is_wonder
bool is_wonder(const struct impr_type *pimprove)
Definition improvement.c:341
is_great_wonder
bool is_great_wonder(const struct impr_type *pimprove)
Definition improvement.c:767
improvements_free
void improvements_free(void)
Definition improvement.c:80
WONDER_NOT_OWNED
#define WONDER_NOT_OWNED
Definition improvement.h:147
B_LAST
#define B_LAST
Definition improvement.h:42
name
const char * name
Definition inputfile.c:127
ioz.h
log.h
fc_assert_msg
#define fc_assert_msg(condition, message,...)
Definition log.h:181
fc_assert_ret_val
#define fc_assert_ret_val(condition, val)
Definition log.h:194
log_debug
#define log_debug(message,...)
Definition log.h:115
log_error
#define log_error(message,...)
Definition log.h:103
main_map_free
void main_map_free(void)
Definition map.c:552
map_num_tiles
int map_num_tiles(void)
Definition map.c:1012
map_init
void map_init(struct civ_map *imap, bool server_side)
Definition map.c:157
map.h
mem.h
FC_FREE
#define FC_FREE(ptr)
Definition mem.h:41
multipliers_free
void multipliers_free(void)
Definition multipliers.c:43
multipliers_init
void multipliers_init(void)
Definition multipliers.c:28
multipliers.h
nations_free
void nations_free(void)
Definition nation.c:636
nation_rule_name
const char * nation_rule_name(const struct nation_type *pnation)
Definition nation.c:137
nation_of_unit
struct nation_type * nation_of_unit(const struct unit *punit)
Definition nation.c:462
nation_of_player
struct nation_type * nation_of_player(const struct player *pplayer)
Definition nation.c:443
nation_of_city
struct nation_type * nation_of_city(const struct city *pcity)
Definition nation.c:453
nation_sets_groups_free
void nation_sets_groups_free(void)
Definition nation.c:1177
nation_sets_groups_init
void nation_sets_groups_init(void)
Definition nation.c:1169
nation.h
packets.h
player_number
int player_number(const struct player *pplayer)
Definition player.c:828
player_slots_free
void player_slots_free(void)
Definition player.c:379
player_ruleset_close
void player_ruleset_close(struct player *pplayer)
Definition player.c:736
player_clear
void player_clear(struct player *pplayer, bool full)
Definition player.c:660
player_slots_init
void player_slots_init(void)
Definition player.c:353
player.h
players_iterate_end
#define players_iterate_end
Definition player.h:535
players_iterate
#define players_iterate(_pplayer)
Definition player.h:530
secfile_destroy
void secfile_destroy(struct section_file *secfile)
Definition section_file.c:95
universal_found_functions_init
void universal_found_functions_init(void)
Definition requirements.c:6359
researches_init
void researches_init(void)
Definition research.c:62
researches_free
void researches_free(void)
Definition research.c:98
research.h
rgbcolor_destroy
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
Definition rgbcolor.c:74
fc_vsnprintcf
int fc_vsnprintcf(char *buf, size_t buf_len, const char *format, const struct cf_sequence *sequences, size_t sequences_num)
Definition shared.c:2190
big_int_to_text
const char * big_int_to_text(unsigned int mantissa, unsigned int exponent)
Definition shared.c:159
shared.h
cf_end
static struct cf_sequence cf_end(void)
Definition shared.h:425
cf_int_seq
static void cf_int_seq(char letter, int value, struct cf_sequence *out)
Definition shared.h:359
cf_str_seq
static struct cf_sequence cf_str_seq(char letter, const char *value)
Definition shared.h:411
spaceship.h
specialists_free
void specialists_free(void)
Definition specialist.c:53
specialists_init
void specialists_init(void)
Definition specialist.c:36
specialist.h
cf_sequence
Definition shared.h:300
city
Definition city.h:309
city::id
int id
Definition city.h:315
city::tile
struct tile * tile
Definition city.h:311
city::units_supported
struct unit_list * units_supported
Definition city.h:391
civ_game
Definition game.h:82
civ_game::diplgoldcost
int diplgoldcost
Definition game.h:139
civ_game::contactturns
int contactturns
Definition game.h:136
civ_game::save_options
struct civ_game::@30::@34::@36 save_options
civ_game::allowed_city_names
enum city_names_mode allowed_city_names
Definition game.h:126
civ_game::unitwaittime
int unitwaittime
Definition game.h:197
civ_game::multiresearch
bool multiresearch
Definition game.h:162
civ_game::incite_gold_capt_chance
int incite_gold_capt_chance
Definition game.h:141
civ_game::nationlist
char * nationlist
Definition game.h:274
civ_game::as_count
size_t as_count
Definition game.h:285
civ_game::mgr_worldchance
int mgr_worldchance
Definition game.h:161
civ_game::plr_colors
struct rgbcolor_list * plr_colors
Definition game.h:242
civ_game::kick_time
int kick_time
Definition game.h:152
civ_game::allowed_govs
const char ** allowed_govs
Definition game.h:277
civ_game::chat
bool chat
Definition game.h:249
civ_game::unit_deallocate
void(* unit_deallocate)(int unit_id)
Definition game.h:293
civ_game::barbarianrate
enum barbarians_rate barbarianrate
Definition game.h:132
civ_game::last_updated_year
bool last_updated_year
Definition game.h:234
civ_game::dispersion
int dispersion
Definition game.h:142
civ_game::max_size
int max_size
Definition game.h:248
civ_game::save_compress_level
int save_compress_level
Definition game.h:180
civ_game::plr_bg_color
struct rgbcolor * plr_bg_color
Definition game.h:102
civ_game::tcptimeout
int tcptimeout
Definition game.h:194
civ_game::server
struct civ_game::@30::@34 server
civ_game::start_units
char start_units[MAX_LEN_STARTUNIT]
Definition game.h:188
civ_game::save_nturns
int save_nturns
Definition game.h:182
civ_game::debug
bool debug[DEBUG_LAST]
Definition game.h:201
civ_game::scenario_desc
struct packet_scenario_description scenario_desc
Definition game.h:88
civ_game::description_file
char * description_file
Definition game.h:273
civ_game::mgr_nationchance
int mgr_nationchance
Definition game.h:159
civ_game::connectmsg
char connectmsg[MAX_LEN_MSG]
Definition game.h:218
civ_game::save_private_map
bool save_private_map
Definition game.h:258
civ_game::techlost_recv
int techlost_recv
Definition game.h:193
civ_game::control
struct packet_ruleset_control control
Definition game.h:83
civ_game::ruleset_summary
char * ruleset_summary
Definition game.h:84
civ_game::mgr_foodneeded
bool mgr_foodneeded
Definition game.h:158
civ_game::event_cache
struct civ_game::@30::@34::@35 event_cache
civ_game::diplchance
int diplchance
Definition game.h:137
civ_game::netwait
int netwait
Definition game.h:167
civ_game::nc_agovs
char ** nc_agovs
Definition game.h:278
civ_game::callbacks
struct civ_game::@32 callbacks
civ_game::fogofwar_old
bool fogofwar_old
Definition game.h:232
civ_game::incite_gold_loss_chance
int incite_gold_loss_chance
Definition game.h:140
civ_game::end_turn
int end_turn
Definition game.h:143
civ_game::plrcolormode
enum plrcolor_mode plrcolormode
Definition game.h:127
civ_game::onsetbarbarian
int onsetbarbarian
Definition game.h:170
civ_game::spaceship_travel_time
int spaceship_travel_time
Definition game.h:178
civ_game::demography
char demography[MAX_LEN_DEMOGRAPHY]
Definition game.h:237
civ_game::info
struct packet_game_info info
Definition game.h:89
civ_game::mgr_turninterval
int mgr_turninterval
Definition game.h:160
civ_game::user_message
char user_message[256]
Definition game.h:262
civ_game::min_players
int min_players
Definition game.h:165
civ_game::timeoutcounter
int timeoutcounter
Definition game.h:206
civ_game::endspaceship
bool endspaceship
Definition game.h:144
civ_game::last_ping
time_t last_ping
Definition game.h:209
civ_game::scoreloglevel
enum scorelog_level scoreloglevel
Definition game.h:221
civ_game::rulesetdir
char rulesetdir[MAX_LEN_NAME]
Definition game.h:236
civ_game::start_year
int start_year
Definition game.h:190
civ_game::migration
bool migration
Definition game.h:163
civ_game::additional_phase_seconds
int additional_phase_seconds
Definition game.h:211
civ_game::luadata
struct section_file * luadata
Definition game.h:244
civ_game::diplbulbcost
int diplbulbcost
Definition game.h:138
civ_game::scoreturn
int scoreturn
Definition game.h:223
civ_game::meta_info
struct civ_game::@30::@34::@37 meta_info
civ_game::seed
randseed seed
Definition game.h:225
civ_game::natural_city_names
bool natural_city_names
Definition game.h:166
civ_game::embedded_nations
char ** embedded_nations
Definition game.h:275
civ_game::ruledit
struct civ_game::@30::@34::@39 ruledit
civ_game::maxconnectionsperhost
int maxconnectionsperhost
Definition game.h:154
civ_game::scenario
struct packet_scenario_info scenario
Definition game.h:87
civ_game::timeoutint
int timeoutint
Definition game.h:202
civ_game::pingtimeout
int pingtimeout
Definition game.h:172
civ_game::nc_astyles
char ** nc_astyles
Definition game.h:284
civ_game::occupychance
int occupychance
Definition game.h:169
civ_game::killunhomed
int killunhomed
Definition game.h:153
civ_game::nuclear_winter_percent
int nuclear_winter_percent
Definition game.h:230
civ_game::conquercost
int conquercost
Definition game.h:135
civ_game::revealmap
unsigned revealmap
Definition game.h:176
civ_game::pingtime
int pingtime
Definition game.h:171
civ_game::allowed_terrains
const char ** allowed_terrains
Definition game.h:280
civ_game::ruleset_description
char * ruleset_description
Definition game.h:85
civ_game::civilwarsize
int civilwarsize
Definition game.h:134
civ_game::save_known
bool save_known
Definition game.h:255
civ_game::ag_count
size_t ag_count
Definition game.h:279
civ_game::savepalace
bool savepalace
Definition game.h:186
civ_game::freecost
int freecost
Definition game.h:147
civ_game::allowed_styles
const char ** allowed_styles
Definition game.h:283
civ_game::aqueductloss
int aqueductloss
Definition game.h:128
civ_game::save_name
char save_name[MAX_LEN_NAME]
Definition game.h:219
civ_game::save_compress_type
enum fz_method save_compress_type
Definition game.h:181
civ_game::trait_dist
enum trait_dist_mode trait_dist
Definition game.h:164
civ_game::foggedborders
bool foggedborders
Definition game.h:146
civ_game::nc_aterrs
char ** nc_aterrs
Definition game.h:281
civ_game::embedded_nations_count
size_t embedded_nations_count
Definition game.h:276
civ_game::ruleset_capabilities
char * ruleset_capabilities
Definition game.h:86
civ_game::timeoutincmult
int timeoutincmult
Definition game.h:204
civ_game::homecaughtunits
bool homecaughtunits
Definition game.h:187
civ_game::at_count
size_t at_count
Definition game.h:282
civ_game::timeoutinc
int timeoutinc
Definition game.h:203
civ_game::allow_take
char allow_take[MAX_LEN_ALLOW_TAKE]
Definition game.h:238
civ_game::autoattack
bool autoattack
Definition game.h:130
civ_game::phase_mode_stored
int phase_mode_stored
Definition game.h:215
civ_game::max_players
int max_players
Definition game.h:155
civ_game::revolution_length
int revolution_length
Definition game.h:177
civ_game::turns
int turns
Definition game.h:247
civ_game::save_starts
bool save_starts
Definition game.h:257
civ_game::auto_ai_toggle
bool auto_ai_toggle
Definition game.h:129
civ_game::veteran
struct veteran_system * veteran
Definition game.h:100
civ_game::mgr_distance
int mgr_distance
Definition game.h:157
civ_game::global_warming_percent
int global_warming_percent
Definition game.h:228
civ_game::calendar
struct packet_calendar_info calendar
Definition game.h:90
civ_game::government_during_revolution
struct government * government_during_revolution
Definition game.h:94
civ_game::timeoutintinc
int timeoutintinc
Definition game.h:205
civ_game::techlost_donor
int techlost_donor
Definition game.h:192
civ_game::timeoutaddenemymove
int timeoutaddenemymove
Definition game.h:207
civ_game::scorelog
bool scorelog
Definition game.h:220
civ_game::techpenalty
int techpenalty
Definition game.h:195
civ_game::razechance
int razechance
Definition game.h:175
civ_game::turnblock
bool turnblock
Definition game.h:196
civ_map
Definition map_types.h:71
packet_calendar_info::positive_year_label
char positive_year_label[MAX_LEN_NAME]
Definition packets_gen.h:254
packet_calendar_info::calendar_skip_0
bool calendar_skip_0
Definition packets_gen.h:258
packet_calendar_info::negative_year_label
char negative_year_label[MAX_LEN_NAME]
Definition packets_gen.h:255
packet_calendar_info::calendar_fragment_name
char calendar_fragment_name[MAX_CALENDAR_FRAGMENTS][MAX_LEN_NAME]
Definition packets_gen.h:257
packet_game_info::coolinglevel
int coolinglevel
Definition packets_gen.h:149
packet_game_info::shieldbox
int shieldbox
Definition packets_gen.h:221
packet_game_info::fulltradesize
int fulltradesize
Definition packets_gen.h:158
packet_game_info::restrictinfra
bool restrictinfra
Definition packets_gen.h:218
packet_game_info::celebratesize
int celebratesize
Definition packets_gen.h:140
packet_game_info::borders
enum borders_mode borders
Definition packets_gen.h:133
packet_game_info::team_pooled_research
bool team_pooled_research
Definition packets_gen.h:224
packet_game_info::aifill
int aifill
Definition packets_gen.h:121
packet_game_info::happyborders
enum happyborders_type happyborders
Definition packets_gen.h:177
packet_game_info::disasters
int disasters
Definition packets_gen.h:217
packet_game_info::trading_city
bool trading_city
Definition packets_gen.h:238
packet_game_info::government_during_revolution_id
Government_type_id government_during_revolution_id
Definition packets_gen.h:171
packet_game_info::first_timeout
int first_timeout
Definition packets_gen.h:234
packet_game_info::globalwarming
int globalwarming
Definition packets_gen.h:165
packet_game_info::pop_report_zeroes
int pop_report_zeroes
Definition packets_gen.h:142
packet_game_info::nuclearwinter
int nuclearwinter
Definition packets_gen.h:205
packet_game_info::killstack
bool killstack
Definition packets_gen.h:188
packet_game_info::angrycitizen
int angrycitizen
Definition packets_gen.h:126
packet_game_info::notradesize
int notradesize
Definition packets_gen.h:203
packet_game_info::diplomacy
enum diplomacy_mode diplomacy
Definition packets_gen.h:151
packet_game_info::trading_gold
bool trading_gold
Definition packets_gen.h:239
packet_game_info::rapturedelay
int rapturedelay
Definition packets_gen.h:216
packet_game_info::trade_revenue_style
enum trade_revenue_style trade_revenue_style
Definition packets_gen.h:237
packet_game_info::year_0_hack
bool year_0_hack
Definition packets_gen.h:244
packet_game_info::great_wonder_owners
int great_wonder_owners[B_LAST]
Definition packets_gen.h:175
packet_game_info::cooling
int cooling
Definition packets_gen.h:148
packet_game_info::is_edit_mode
bool is_edit_mode
Definition packets_gen.h:185
packet_game_info::trading_tech
bool trading_tech
Definition packets_gen.h:240
packet_game_info::global_advances
bool global_advances[A_LAST]
Definition packets_gen.h:163
packet_game_info::is_new_game
bool is_new_game
Definition packets_gen.h:186
packet_game_info::infrapoints
int infrapoints
Definition packets_gen.h:168
packet_game_info::warminglevel
int warminglevel
Definition packets_gen.h:242
packet_game_info::airlifting_style
enum airlifting_style airlifting_style
Definition packets_gen.h:123
packet_game_info::skill_level
enum ai_level skill_level
Definition packets_gen.h:222
packet_game_info::revolentype
enum revolen_type revolentype
Definition packets_gen.h:169
packet_game_info::gold
int gold
Definition packets_gen.h:166
packet_game_info::phase_mode
enum phase_mode_type phase_mode
Definition packets_gen.h:207
packet_game_info::caravan_bonus_style
enum caravan_bonus_style caravan_bonus_style
Definition packets_gen.h:135
packet_game_info::tech
int tech
Definition packets_gen.h:225
packet_game_info::diplchance_initial_odds
bv_actions diplchance_initial_odds
Definition packets_gen.h:150
packet_game_info::heating
int heating
Definition packets_gen.h:178
packet_game_info::turn
int turn
Definition packets_gen.h:241
packet_game_info::year
int year
Definition packets_gen.h:243
packet_game_info::sciencebox
int sciencebox
Definition packets_gen.h:220
packet_game_info::trademindist
int trademindist
Definition packets_gen.h:236
packet_game_info::nuclear_winter
bool nuclear_winter
Definition packets_gen.h:204
packet_game_info::fogofwar
bool fogofwar
Definition packets_gen.h:152
packet_game_info::foodbox
int foodbox
Definition packets_gen.h:154
packet_game_info::victory_conditions
enum victory_condition_type victory_conditions
Definition packets_gen.h:223
packet_game_info::global_warming
bool global_warming
Definition packets_gen.h:164
packet_game_info::citymindist
int citymindist
Definition packets_gen.h:147
packet_game_info::default_government_id
Government_type_id default_government_id
Definition packets_gen.h:170
packet_game_info::global_advance_count
int global_advance_count
Definition packets_gen.h:162
packet_game_info::killcitizen
bool killcitizen
Definition packets_gen.h:187
packet_game_info::timeout
int timeout
Definition packets_gen.h:233
packet_ruleset_control::preferred_soundset
char preferred_soundset[MAX_LEN_NAME]
Definition packets_gen.h:1478
packet_ruleset_control::num_styles
int num_styles
Definition packets_gen.h:1468
packet_ruleset_control::num_unit_types
int num_unit_types
Definition packets_gen.h:1456
packet_ruleset_control::num_impr_types
int num_impr_types
Definition packets_gen.h:1457
packet_ruleset_control::nation_count
int nation_count
Definition packets_gen.h:1471
packet_ruleset_control::num_road_types
int num_road_types
Definition packets_gen.h:1462
packet_ruleset_control::terrain_count
int terrain_count
Definition packets_gen.h:1473
packet_ruleset_control::preferred_tileset
char preferred_tileset[MAX_LEN_NAME]
Definition packets_gen.h:1477
packet_ruleset_control::num_music_styles
int num_music_styles
Definition packets_gen.h:1469
packet_ruleset_control::num_tech_types
int num_tech_types
Definition packets_gen.h:1459
packet_ruleset_control::government_count
int government_count
Definition packets_gen.h:1470
packet_ruleset_control::styles_count
int styles_count
Definition packets_gen.h:1472
packet_ruleset_control::num_disaster_types
int num_disaster_types
Definition packets_gen.h:1465
packet_ruleset_control::num_achievement_types
int num_achievement_types
Definition packets_gen.h:1466
packet_ruleset_control::num_specialist_types
int num_specialist_types
Definition packets_gen.h:1474
packet_ruleset_control::preferred_musicset
char preferred_musicset[MAX_LEN_NAME]
Definition packets_gen.h:1479
packet_ruleset_control::num_unit_classes
int num_unit_classes
Definition packets_gen.h:1455
packet_ruleset_control::num_resource_types
int num_resource_types
Definition packets_gen.h:1463
packet_ruleset_control::num_nation_sets
int num_nation_sets
Definition packets_gen.h:1476
packet_ruleset_control::num_nation_groups
int num_nation_groups
Definition packets_gen.h:1475
packet_ruleset_control::num_base_types
int num_base_types
Definition packets_gen.h:1461
packet_scenario_description::description
char description[MAX_LEN_CONTENT]
Definition packets_gen.h:1622
packet_scenario_info::lake_flooding
bool lake_flooding
Definition packets_gen.h:1612
packet_scenario_info::have_resources
bool have_resources
Definition packets_gen.h:1617
packet_scenario_info::is_scenario
bool is_scenario
Definition packets_gen.h:1605
packet_scenario_info::ruleset_locked
bool ruleset_locked
Definition packets_gen.h:1615
packet_scenario_info::allow_ai_type_fallback
bool allow_ai_type_fallback
Definition packets_gen.h:1614
packet_scenario_info::players
bool players
Definition packets_gen.h:1608
packet_scenario_info::authors
char authors[MAX_LEN_PACKET/3]
Definition packets_gen.h:1607
packet_scenario_info::name
char name[256]
Definition packets_gen.h:1606
packet_scenario_info::prevent_new_cities
bool prevent_new_cities
Definition packets_gen.h:1611
packet_scenario_info::handmade
bool handmade
Definition packets_gen.h:1613
packet_scenario_info::startpos_nations
bool startpos_nations
Definition packets_gen.h:1609
packet_scenario_info::save_random
bool save_random
Definition packets_gen.h:1610
player
Definition player.h:249
player::cities
struct city_list * cities
Definition player.h:281
player::team
struct team * team
Definition player.h:261
tile
Definition tile.h:49
unit
Definition unit.h:138
unit::id
int id
Definition unit.h:145
unit::homecity
int homecity
Definition unit.h:146
user_flag
Definition game.h:73
user_flag::name
char * name
Definition game.h:74
user_flag::helptxt
char * helptxt
Definition game.h:75
world
Definition world_object.h:37
world::map
struct civ_map map
Definition world_object.h:38
styles_free
void styles_free(void)
Definition style.c:51
music_styles_free
void music_styles_free(void)
Definition style.c:148
style.h
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:969
fc_isalnum
bool fc_isalnum(char c)
Definition support.c:1205
support.h
sz_strlcpy
#define sz_strlcpy(dest, src)
Definition support.h:161
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
team_slots_free
void team_slots_free(void)
Definition team.c:85
team_number
int team_number(const struct team *pteam)
Definition team.c:391
team_slots_init
void team_slots_init(void)
Definition team.c:53
tech_classes_init
void tech_classes_init(void)
Definition tech.c:307
techs_init
void techs_init(void)
Definition tech.c:459
techs_free
void techs_free(void)
Definition tech.c:510
user_tech_flags_init
void user_tech_flags_init(void)
Definition tech.c:370
user_tech_flags_free
void user_tech_flags_free(void)
Definition tech.c:382
tech.h
A_LAST
#define A_LAST
Definition tech.h:45
user_terrain_flags_init
void user_terrain_flags_init(void)
Definition terrain.c:752
terrains_free
void terrains_free(void)
Definition terrain.c:59
terrains_init
void terrains_init(void)
Definition terrain.c:42
user_terrain_flags_free
void user_terrain_flags_free(void)
Definition terrain.c:764
terrain.h
tile_set_worked
void tile_set_worked(struct tile *ptile, struct city *pcity)
Definition tile.c:106
tile_worked
#define tile_worked(_tile)
Definition tile.h:113
TILE_XY
#define TILE_XY(ptile)
Definition tile.h:42
trade_route_types_init
void trade_route_types_init(void)
Definition traderoutes.c:134
goods_init
void goods_init(void)
Definition traderoutes.c:546
goods_free
void goods_free(void)
Definition traderoutes.c:562
traderoutes.h
unit_virtual_destroy
void unit_virtual_destroy(struct unit *punit)
Definition unit.c:1715
unit.h
unit_tile
#define unit_tile(_pu)
Definition unit.h:388
unit_owner
#define unit_owner(_pu)
Definition unit.h:387
unitlist.h
unit_types_init
void unit_types_init(void)
Definition unittype.c:2394
user_unit_type_flags_init
void user_unit_type_flags_init(void)
Definition unittype.c:1916
unit_class_flags_free
void unit_class_flags_free(void)
Definition unittype.c:2459
unit_rule_name
const char * unit_rule_name(const struct unit *punit)
Definition unittype.c:1639
unit_types_free
void unit_types_free(void)
Definition unittype.c:2433
veteran_system_destroy
void veteran_system_destroy(struct veteran_system *vsystem)
Definition unittype.c:2706
unit_classes_free
void unit_classes_free(void)
Definition unittype.c:2576
unit_type_flags_free
void unit_type_flags_free(void)
Definition unittype.c:2447
user_unit_class_flags_init
void user_unit_class_flags_init(void)
Definition unittype.c:1852
unit_classes_init
void unit_classes_init(void)
Definition unittype.c:2554
role_unit_precalcs_free
void role_unit_precalcs_free(void)
Definition unittype.c:2208
victory.h