Feature #1888 » 0062-Add-select_actres_action_unit_on_stack.patch
| common/actions.c | ||
|---|---|---|
|
return actlist_by_activity[activity];
|
||
|
}
|
||
|
/************************************************************************//**
|
||
|
Can unit do any action with the given action result to stack?
|
||
|
Returns one of the possible actions, or ACTION_NONE.
|
||
|
****************************************************************************/
|
||
|
enum unit_activity select_actres_action_unit_on_stack(struct civ_map *nmap,
|
||
|
enum action_result actres,
|
||
|
struct unit *punit,
|
||
|
struct tile *ptile)
|
||
|
{
|
||
|
action_list_iterate(action_list_by_result(actres), paction) {
|
||
|
enum gen_action act = action_number(paction);
|
||
|
if (is_action_enabled_unit_on_stack(nmap, act, punit, ptile)) {
|
||
|
return act;
|
||
|
}
|
||
|
} action_list_iterate_end;
|
||
|
return ACTION_NONE;
|
||
|
}
|
||
| common/actions.h | ||
|---|---|---|
|
const struct action_auto_perf *action_auto_perf_by_number(const int num);
|
||
|
struct action_auto_perf *action_auto_perf_slot_number(const int num);
|
||
|
enum unit_activity select_actres_action_unit_on_stack(struct civ_map *nmap,
|
||
|
enum action_result actres,
|
||
|
struct unit *punit,
|
||
|
struct tile *ptile);
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif /* __cplusplus */
|
||