Feature #2243 ยป 0070-Move-count_diplomats_on_tile-from-server-to-default-.patch
| ai/default/daidiplomat.c | ||
|---|---|---|
|
struct city **ctarget, int *move_dist,
|
||
|
struct pf_map *pfm);
|
||
|
/************************************************************************//**
|
||
|
Return number of diplomats on this square. AJS 20000130
|
||
|
****************************************************************************/
|
||
|
static int count_diplomats_on_tile(struct tile *ptile)
|
||
|
{
|
||
|
int count = 0;
|
||
|
unit_list_iterate((ptile)->units, punit) {
|
||
|
if (unit_has_type_flag(punit, UTYF_DIPLOMAT)) {
|
||
|
count++;
|
||
|
}
|
||
|
} unit_list_iterate_end;
|
||
|
return count;
|
||
|
}
|
||
|
/**************************************************************************//**
|
||
|
Number of techs that we don't have and the enemy (tplayer) does.
|
||
|
******************************************************************************/
|
||
| server/diplomats.c | ||
|---|---|---|
|
vlink = tile_link(target_tile);
|
||
|
}
|
||
|
/* this may cause a diplomatic incident */
|
||
|
/* This may cause a diplomatic incident */
|
||
|
action_consequence_success(paction, pplayer, act_utype,
|
||
|
tile_owner(target_tile),
|
||
|
target_tile, vlink);
|
||
| ... | ... | |
|
return TRUE;
|
||
|
}
|
||
|
/************************************************************************//**
|
||
|
Return number of diplomats on this square. AJS 20000130
|
||
|
****************************************************************************/
|
||
|
int count_diplomats_on_tile(struct tile *ptile)
|
||
|
{
|
||
|
int count = 0;
|
||
|
unit_list_iterate((ptile)->units, punit) {
|
||
|
if (unit_has_type_flag(punit, UTYF_DIPLOMAT)) {
|
||
|
count++;
|
||
|
}
|
||
|
} unit_list_iterate_end;
|
||
|
return count;
|
||
|
}
|
||
| server/diplomats.h | ||
|---|---|---|
|
struct tile *target_tile,
|
||
|
const struct action *paction);
|
||
|
int count_diplomats_on_tile(struct tile *ptile);
|
||
|
#endif /* FC__DIPLOMATS_H */
|
||