Project

General

Profile

Feature #1052 » 0057-Unhardcode-wld.map-from-city_choose_build_default.patch

main, S3_2 - Marko Lindqvist, 11/02/2024 08:38 AM

View differences:

ai/default/daisettler.c
saved_owner = tile_owner(result->tile);
saved_claimer = tile_claimer(result->tile);
tile_set_owner(result->tile, pplayer, result->tile); /* Temporarily */
city_choose_build_default(pcity); /* ?? */
city_choose_build_default(nmap, pcity); /* ?? */
virtual_city = TRUE;
}
common/city.c
/**********************************************************************//**
Always tile_set_owner(ptile, pplayer) sometime before this!
**************************************************************************/
void city_choose_build_default(struct city *pcity)
void city_choose_build_default(const struct civ_map *nmap, struct city *pcity)
{
const struct civ_map *nmap = &(wld.map);
if (NULL == city_tile(pcity)) {
/* When a "dummy" city is created with no tile, then choosing a build
* target could fail. This currently might happen during map editing.
common/city.h
bool city_can_grow_to(const struct city *pcity, int pop_size);
bool city_can_change_build(const struct city *pcity);
void city_choose_build_default(struct city *pcity);
void city_choose_build_default(const struct civ_map *nmap, struct city *pcity);
/* Textual representation of buildings */
server/citytools.c
struct city *pcity;
const citizens old_content_citizens = player_content_citizens(pplayer);
const citizens old_angry_citizens = player_angry_citizens(pplayer);
const struct civ_map *nmap = &(wld.map);
log_debug("create_city() %s", name);
......
adv_city_alloc(pcity);
tile_set_owner(ptile, pplayer, ptile); /* Temporarily */
city_choose_build_default(pcity);
city_choose_build_default(nmap, pcity);
pcity->id = identity_number();
fc_mutex_allocate(&game.server.mutexes.city_list);
(1-1/2)