Project

General

Profile

Feature #1155 ยป 0073-AI-Pass-civ_map-to-dai_choose_bodyguard.patch

Marko Lindqvist, 11/23/2024 09:00 AM

View differences:

ai/default/daimilitary.c
is the only role being considered worthy of bodyguarding in findjob.
**************************************************************************/
static struct unit_type *dai_choose_bodyguard(struct ai_type *ait,
const struct civ_map *nmap,
struct city *pcity,
enum terrain_class tc,
enum unit_role_id role,
......
struct unit_type *bestid = NULL;
adv_want best = 0;
struct player *pplayer = city_owner(pcity);
const struct civ_map *nmap = &(wld.map);
simple_ai_unit_type_iterate(putype) {
/* Only consider units of given role, or any if invalid given */
......
}
/* Consider making a land bodyguard */
punittype = dai_choose_bodyguard(ait, pcity, TC_LAND, L_DEFEND_GOOD,
punittype = dai_choose_bodyguard(ait, nmap, pcity, TC_LAND, L_DEFEND_GOOD,
allow_gold_upkeep);
if (punittype) {
dai_unit_consider_bodyguard(ait, pcity, punittype, choice);
......
dai_choose_diplomat_offensive(ait, pplayer, pcity, choice);
/* Consider making a sea bodyguard */
punittype = dai_choose_bodyguard(ait, pcity, TC_OCEAN, L_DEFEND_GOOD,
punittype = dai_choose_bodyguard(ait, nmap, pcity, TC_OCEAN, L_DEFEND_GOOD,
allow_gold_upkeep);
if (punittype) {
dai_unit_consider_bodyguard(ait, pcity, punittype, choice);
    (1-1/1)