Project

General

Profile

Feature #144 » 0034-Move-action_target_kind_default-to-actres.c-under-na.patch

Marko Lindqvist, 01/08/2024 08:30 AM

View differences:

common/actions.c
BV_CLR_ALL(action->sub_results);
action->actor_kind = AAK_UNIT;
action->target_kind = action_target_kind_default(result);
action->target_kind = actres_target_kind_default(result);
action->sub_target_kind = action_sub_target_kind_default(result);
action->target_complexity = actres_target_compl_calc(result);
......
return NULL;
}
/**********************************************************************//**
Return default target kind for the action with the specified result.
**************************************************************************/
enum action_target_kind
action_target_kind_default(enum action_result result)
{
fc_assert_ret_val(action_result_is_valid(result) || result == ACTRES_NONE,
RS_DEFAULT_USER_ACTION_TARGET_KIND);
switch (result) {
case ACTRES_ESTABLISH_EMBASSY:
case ACTRES_SPY_INVESTIGATE_CITY:
case ACTRES_SPY_POISON:
case ACTRES_SPY_STEAL_GOLD:
case ACTRES_SPY_SABOTAGE_CITY:
case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
case ACTRES_SPY_STEAL_TECH:
case ACTRES_SPY_TARGETED_STEAL_TECH:
case ACTRES_SPY_INCITE_CITY:
case ACTRES_TRADE_ROUTE:
case ACTRES_MARKETPLACE:
case ACTRES_HELP_WONDER:
case ACTRES_JOIN_CITY:
case ACTRES_STEAL_MAPS:
case ACTRES_SPY_NUKE:
case ACTRES_DESTROY_CITY:
case ACTRES_DISBAND_UNIT_RECOVER:
case ACTRES_HOME_CITY:
case ACTRES_UPGRADE_UNIT:
case ACTRES_AIRLIFT:
case ACTRES_STRIKE_BUILDING:
case ACTRES_STRIKE_PRODUCTION:
case ACTRES_CONQUER_CITY:
case ACTRES_SPY_SPREAD_PLAGUE:
case ACTRES_SPY_ESCAPE:
return ATK_CITY;
case ACTRES_SPY_BRIBE_UNIT:
case ACTRES_SPY_SABOTAGE_UNIT:
case ACTRES_EXPEL_UNIT:
case ACTRES_HEAL_UNIT:
case ACTRES_TRANSPORT_DEBOARD:
case ACTRES_TRANSPORT_UNLOAD:
case ACTRES_TRANSPORT_LOAD:
case ACTRES_TRANSPORT_BOARD:
case ACTRES_TRANSPORT_EMBARK:
return ATK_UNIT;
case ACTRES_BOMBARD:
case ACTRES_ATTACK:
case ACTRES_WIPE_UNITS:
case ACTRES_CAPTURE_UNITS:
case ACTRES_NUKE_UNITS:
case ACTRES_SPY_ATTACK:
case ACTRES_COLLECT_RANSOM:
return ATK_UNITS;
case ACTRES_FOUND_CITY:
case ACTRES_NUKE:
case ACTRES_PARADROP:
case ACTRES_PARADROP_CONQUER:
case ACTRES_TRANSFORM_TERRAIN:
case ACTRES_CULTIVATE:
case ACTRES_PLANT:
case ACTRES_PILLAGE:
case ACTRES_CLEAN:
case ACTRES_ROAD:
case ACTRES_BASE:
case ACTRES_MINE:
case ACTRES_IRRIGATE:
case ACTRES_TRANSPORT_DISEMBARK:
case ACTRES_HUT_ENTER:
case ACTRES_HUT_FRIGHTEN:
case ACTRES_UNIT_MOVE:
case ACTRES_TELEPORT:
case ACTRES_TELEPORT_CONQUER:
return ATK_TILE;
case ACTRES_CONQUER_EXTRAS:
return ATK_EXTRAS;
case ACTRES_DISBAND_UNIT:
case ACTRES_CONVERT:
case ACTRES_FORTIFY:
case ACTRES_HOMELESS:
case ACTRES_ENABLER_CHECK:
return ATK_SELF;
case ACTRES_NONE:
return RS_DEFAULT_USER_ACTION_TARGET_KIND;
ASSERT_UNUSED_ACTRES_CASES;
}
/* Should never be reached. */
return RS_DEFAULT_USER_ACTION_TARGET_KIND;
}
/**********************************************************************//**
Returns TRUE iff the specified action result works with the specified
action target kind.
common/actions.h
const char *action_max_range_ruleset_var_name(int act);
const char *action_target_kind_ruleset_var_name(int act);
enum action_target_kind
action_target_kind_default(enum action_result result);
bool action_result_legal_target_kind(enum action_result result,
enum action_target_kind tgt_kind);
const char *action_target_kind_help(enum action_target_kind kind);
common/actres.c
static struct actres act_results[ACTRES_LAST] = {
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_ESTABLISH_EMBASSY */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_SPY_INVESTIGATE_CITY */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_POISON */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_STEAL_GOLD */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_SABOTAGE_CITY */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_MANDATORY, ABK_DIPLOMATIC, /* ACTRES_SPY_TARGETED_SABOTAGE_CITY */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_SABOTAGE_CITY_PRODUCTION */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_STEAL_TECH */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_MANDATORY, ABK_DIPLOMATIC, /* ACTRES_SPY_TARGETED_STEAL_TECH */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_INCITE_CITY */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRADE_ROUTE */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_MARKETPLACE */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_HELP_WONDER */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_BRIBE_UNIT */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_SABOTAGE_UNIT */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_CAPTURE_UNITS */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNITS },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_FOUND_CITY */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_JOIN_CITY */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_STEAL_MAPS */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_BOMBARD */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNITS },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_NUKE */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_NUKE */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_NUKE_UNITS */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNITS },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_DESTROY_CITY */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_EXPEL_UNIT */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_DISBAND_UNIT_RECOVER */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE , ERM_NONE},
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_DISBAND_UNIT */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_SELF },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_HOME_CITY */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_UPGRADE_UNIT */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_PARADROP */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_AIRLIFT */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_STANDARD, /* ACTRES_ATTACK */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNITS },
{ ACT_TGT_COMPL_MANDATORY, ABK_NONE, /* ACTRES_STRIKE_BUILDING */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_STRIKE_PRODUCTION */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_CONQUER_CITY */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_HEAL_UNIT */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSFORM_TERRAIN */
FALSE, ACTIVITY_TRANSFORM, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_CULTIVATE */
FALSE, ACTIVITY_CULTIVATE, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_PLANT */
FALSE, ACTIVITY_PLANT, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_FLEXIBLE, ABK_NONE, /* ACTRES_PILLAGE */
TRUE, ACTIVITY_PILLAGE, DRT_NONE,
EC_NONE, ERM_PILLAGE },
EC_NONE, ERM_PILLAGE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_FORTIFY */
FALSE, ACTIVITY_FORTIFYING, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_SELF },
{ ACT_TGT_COMPL_MANDATORY, ABK_NONE, /* ACTRES_ROAD */
FALSE, ACTIVITY_GEN_ROAD, DRT_NONE,
EC_ROAD, ERM_NONE },
EC_ROAD, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_CONVERT */
FALSE, ACTIVITY_CONVERT, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_SELF },
{ ACT_TGT_COMPL_MANDATORY, ABK_NONE, /* ACTRES_BASE */
FALSE, ACTIVITY_BASE, DRT_NONE,
EC_BASE, ERM_NONE },
EC_BASE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_MANDATORY, ABK_NONE, /* ACTRES_MINE */
FALSE, ACTIVITY_MINE, DRT_NONE,
EC_MINE, ERM_NONE },
EC_MINE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_MANDATORY, ABK_NONE, /* ACTRES_IRRIGATE */
FALSE, ACTIVITY_IRRIGATE, DRT_NONE,
EC_IRRIGATION, ERM_NONE },
EC_IRRIGATION, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_STANDARD, /* ACTRES_COLLECT_RANSOM */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNITS },
{ ACT_TGT_COMPL_FLEXIBLE, ABK_NONE, /* ACTRES_UNUSED_1 */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, RS_DEFAULT_USER_ACTION_TARGET_KIND },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSPORT_DEBOARD */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSPORT_UNLOAD */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSPORT_DISEMBARK */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSPORT_BOARD */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSPORT_EMBARK */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_SPREAD_PLAGUE */
TRUE, ACTIVITY_LAST, DRT_DIPLCHANCE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_DIPLOMATIC, /* ACTRES_SPY_ATTACK */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNITS },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_CONQUER_EXTRAS */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_EXTRAS },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_HUT_ENTER */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_ENTER },
EC_NONE, ERM_ENTER, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_HUT_FRIGHTEN */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_ENTER },
EC_NONE, ERM_ENTER, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_UNIT_MOVE */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_PARADROP_CONQUER */
FALSE, ACTIVITY_LAST, DRT_NONE, /* TODO: Should this be hostile? */
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_HOMELESS */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_SELF },
{ ACT_TGT_COMPL_SIMPLE, ABK_STANDARD, /* ACTRES_WIPE_UNITS */
TRUE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNITS },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_SPY_ESCAPE */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_CITY },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSPORT_LOAD */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_UNIT },
{ ACT_TGT_COMPL_FLEXIBLE, ABK_NONE, /* ACTRES_CLEAN */
FALSE, ACTIVITY_CLEAN, DRT_NONE,
EC_NONE, ERM_CLEAN },
EC_NONE, ERM_CLEAN, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TELEPORT */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TELEPORT_CONQUER */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE },
EC_NONE, ERM_NONE, ATK_TILE },
{ ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_ENABLER_CHECK */
FALSE, ACTIVITY_LAST, DRT_NONE,
EC_NONE, ERM_NONE }
EC_NONE, ERM_NONE, ATK_SELF }
};
/*********************************************************************//**
......
return 0;
}
/**********************************************************************//**
Return default target kind for the action with the specified result.
**************************************************************************/
enum action_target_kind
actres_target_kind_default(enum action_result result)
{
fc_assert_ret_val(action_result_is_valid(result) || result == ACTRES_NONE,
RS_DEFAULT_USER_ACTION_TARGET_KIND);
return act_results[result].def_tgt_kind;
}
/**********************************************************************//**
Does action with the result create the extra
common/actres.h
enum extra_cause ecause; /* Could deduct this from 'activity', but we should merge
* activities completely with actions in the future */
enum extra_rmcause ermcause;
enum action_target_kind def_tgt_kind;
};
void actres_init(void);
......
int actres_min_range_default(enum action_result result);
int actres_max_range_default(enum action_result result);
enum action_target_kind
actres_target_kind_default(enum action_result result);
#ifdef __cplusplus
}
server/ruleset/ruleload.c
action_by_number(act)->target_kind
= secfile_lookup_enum_default(file,
action_target_kind_default(
actres_target_kind_default(
paction->result),
action_target_kind,
"actions.%s",
(1-1/2)