Project

General

Profile

Feature #390 » 0019-Unhardcode-wld.map-from-is_action_enabled_unit_on_ti.patch

S3_1 - Marko Lindqvist, 04/01/2024 01:59 AM

View differences:

ai/default/aiparatrooper.c
tile_city(ptile_dest), NULL,
ptile_dest, NULL));
} else {
possible = is_action_enabled_unit_on_tile(paction->id, punit,
possible = is_action_enabled_unit_on_tile(nmap, paction->id, punit,
ptile_dest, NULL);
}
ai/default/aitools.c
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_NUKE_UNITS);
} else if (action_id_get_target_kind(ACTION_NUKE) == ATK_TILE
&& is_action_enabled_unit_on_tile(ACTION_NUKE,
&& is_action_enabled_unit_on_tile(nmap, ACTION_NUKE,
punit, ptile, NULL)) {
/* Choose "Explode Nuclear". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
......
unit_do_action(unit_owner(punit), punit->id, tcity->id,
0, "", ACTION_NUKE);
} else if (action_id_get_target_kind(ACTION_NUKE_CITY) == ATK_TILE
&& is_action_enabled_unit_on_tile(ACTION_NUKE_CITY,
&& is_action_enabled_unit_on_tile(nmap, ACTION_NUKE_CITY,
punit, ptile, NULL)) {
/* Choose "Nuke City". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
......
/* "Transport Embark 3". */
unit_do_action(unit_owner(punit), punit->id, ptrans->id,
0, "", ACTION_TRANSPORT_EMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK1,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK1,
punit, ptile, NULL)) {
/* "Transport Disembark". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_TRANSPORT_DISEMBARK1);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK2,
punit, ptile, NULL)) {
/* "Transport Disembark 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_TRANSPORT_DISEMBARK2);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK3,
punit, ptile, NULL)) {
/* "Transport Disembark 3". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_TRANSPORT_DISEMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK4,
punit, ptile, NULL)) {
/* "Transport Disembark 4". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
......
/* Choose "Conquer Extras 4". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_CONQUER_EXTRAS4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER,
punit, ptile, NULL)) {
/* Choose "Enter Hut". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_ENTER);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER2,
punit, ptile, NULL)) {
/* Choose "Enter Hut 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_ENTER2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER3,
punit, ptile, NULL)) {
/* Choose "Enter Hut 3". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_ENTER3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER4,
punit, ptile, NULL)) {
/* Choose "Enter Hut 4". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_ENTER4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN,
punit, ptile, NULL)) {
/* Choose "Frighten Hut". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_FRIGHTEN);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN2,
punit, ptile, NULL)) {
/* Choose "Frighten Hut 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_FRIGHTEN2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN3,
punit, ptile, NULL)) {
/* Choose "Frighten Hut 3". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_FRIGHTEN3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN4,
punit, ptile, NULL)) {
/* Choose "Frighten Hut 4". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_FRIGHTEN4);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE,
punit, ptile, NULL)) {
/* Choose "Unit Move". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_UNIT_MOVE);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE2,
punit, ptile, NULL)) {
/* Choose "Unit Move 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
......
punit, ptrans)) {
/* "Transport Embark 3". */
paction = action_by_number(ACTION_TRANSPORT_EMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK1,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK1,
punit, ptile, NULL)) {
/* "Transport Disembark". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK1);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK2,
punit, ptile, NULL)) {
/* "Transport Disembark 2". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK2);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK3,
punit, ptile, NULL)) {
/* "Transport Disembark 3". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK4,
punit, ptile, NULL)) {
/* "Transport Disembark 4". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER,
punit, ptile, NULL)) {
/* "Enter Hut". */
paction = action_by_number(ACTION_HUT_ENTER);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER2,
punit, ptile, NULL)) {
/* "Enter Hut 2". */
paction = action_by_number(ACTION_HUT_ENTER2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER3,
punit, ptile, NULL)) {
/* "Enter Hut 3". */
paction = action_by_number(ACTION_HUT_ENTER3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER4,
punit, ptile, NULL)) {
/* "Enter Hut 4". */
paction = action_by_number(ACTION_HUT_ENTER4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN,
punit, ptile, NULL)) {
/* "Frighten Hut". */
paction = action_by_number(ACTION_HUT_FRIGHTEN);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN2,
punit, ptile, NULL)) {
/* "Frighten Hut 2". */
paction = action_by_number(ACTION_HUT_FRIGHTEN2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN3,
punit, ptile, NULL)) {
/* "Frighten Hut 3". */
paction = action_by_number(ACTION_HUT_FRIGHTEN3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN4,
punit, ptile, NULL)) {
/* "Frighten Hut 4". */
paction = action_by_number(ACTION_HUT_FRIGHTEN4);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE,
punit, ptile, NULL)) {
/* "Unit Move". */
paction = action_by_number(ACTION_UNIT_MOVE);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE2,
punit, ptile, NULL)) {
/* "Unit Move 2". */
paction = action_by_number(ACTION_UNIT_MOVE2);
common/actions.c
/* Can't be enabled. No target. */
continue;
}
if (is_action_enabled_unit_on_tile(blocker->id,
if (is_action_enabled_unit_on_tile(nmap, blocker->id,
actor_unit, target_tile, NULL)) {
return blocker;
}
......
See note in is_action_enabled() for why the action may still be disabled.
**************************************************************************/
bool is_action_enabled_unit_on_tile(const action_id wanted_action,
bool is_action_enabled_unit_on_tile(const struct civ_map *nmap,
const action_id wanted_action,
const struct unit *actor_unit,
const struct tile *target_tile,
const struct extra_type *target_extra)
{
const struct civ_map *nmap = &(wld.map);
return is_action_enabled_unit_on_tile_full(nmap, wanted_action, actor_unit,
unit_home(actor_unit),
unit_tile(actor_unit),
common/actions.h
const struct unit *actor_unit,
const struct tile *target_tile);
bool is_action_enabled_unit_on_tile(const action_id wanted_action,
bool is_action_enabled_unit_on_tile(const struct civ_map *nmap,
const action_id wanted_action,
const struct unit *actor_unit,
const struct tile *target_tile,
const struct extra_type *target_extra);
common/unit.c
{ \
switch (action_get_target_kind(paction)) { \
case ATK_TILE: \
return is_action_enabled_unit_on_tile(paction->id, \
return is_action_enabled_unit_on_tile(nmap, paction->id, \
punit, ptile, target); \
case ATK_EXTRAS: \
return is_action_enabled_unit_on_extras(paction->id, \
......
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_CLEAN_POLLUTION,
return is_action_enabled_unit_on_tile(nmap, ACTION_CLEAN_POLLUTION,
punit, ptile, target);
case ACTIVITY_FALLOUT:
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_CLEAN_FALLOUT,
return is_action_enabled_unit_on_tile(nmap, ACTION_CLEAN_FALLOUT,
punit, ptile, target);
case ACTIVITY_MINE:
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_MINE, punit,
return is_action_enabled_unit_on_tile(nmap, ACTION_MINE, punit,
ptile, target);
case ACTIVITY_PLANT:
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_PLANT,
return is_action_enabled_unit_on_tile(nmap, ACTION_PLANT,
punit, ptile, NULL);
case ACTIVITY_IRRIGATE:
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_IRRIGATE, punit,
return is_action_enabled_unit_on_tile(nmap, ACTION_IRRIGATE, punit,
ptile, target);
case ACTIVITY_CULTIVATE:
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_CULTIVATE,
return is_action_enabled_unit_on_tile(nmap, ACTION_CULTIVATE,
punit, ptile, NULL);
case ACTIVITY_FORTIFYING:
......
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_BASE,
return is_action_enabled_unit_on_tile(nmap, ACTION_BASE,
punit, ptile, target);
case ACTIVITY_GEN_ROAD:
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_ROAD,
return is_action_enabled_unit_on_tile(nmap, ACTION_ROAD,
punit, ptile, target);
case ACTIVITY_SENTRY:
......
/* The call below doesn't support actor tile speculation. */
fc_assert_msg(unit_tile(punit) == ptile,
"Please use action_speculate_unit_on_tile()");
return is_action_enabled_unit_on_tile(ACTION_TRANSFORM_TERRAIN,
return is_action_enabled_unit_on_tile(nmap, ACTION_TRANSFORM_TERRAIN,
punit, ptile, NULL);
case ACTIVITY_CONVERT:
server/actiontools.c
break;
case ATK_TILE:
if (tgt_tile
&& is_action_enabled_unit_on_tile(act, actor, tgt_tile,
target_extra)) {
&& is_action_enabled_unit_on_tile(nmap, act, actor,
tgt_tile, target_extra)) {
perform_action_to(act, actor, tgt_tile->index,
target_extra ? extra_number(target_extra) : -1);
}
......
break;
case ATK_TILE:
if (tgt_tile
&& is_action_enabled_unit_on_tile(act, actor, tgt_tile, target_extra)) {
&& is_action_enabled_unit_on_tile(nmap, act, actor,
tgt_tile, target_extra)) {
current = action_prob_vs_tile(actor, act, tgt_tile, target_extra);
}
break;
server/advisors/advgoto.c
punit, ptrans)) {
/* "Transport Embark 3". */
paction = action_by_number(ACTION_TRANSPORT_EMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK1,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK1,
punit, ptile, NULL)) {
/* "Transport Disembark". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK1);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK2,
punit, ptile, NULL)) {
/* "Transport Disembark 2". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK2);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK3,
punit, ptile, NULL)) {
/* "Transport Disembark 3". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK4,
punit, ptile, NULL)) {
/* "Transport Disembark 4". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER,
punit, ptile, NULL)) {
/* "Enter Hut". */
paction = action_by_number(ACTION_HUT_ENTER);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER2,
punit, ptile, NULL)) {
/* "Enter Hut 2". */
paction = action_by_number(ACTION_HUT_ENTER2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER3,
punit, ptile, NULL)) {
/* "Enter Hut 3". */
paction = action_by_number(ACTION_HUT_ENTER3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER4,
punit, ptile, NULL)) {
/* "Enter Hut 4". */
paction = action_by_number(ACTION_HUT_ENTER4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN,
punit, ptile, NULL)) {
/* "Frighten Hut". */
paction = action_by_number(ACTION_HUT_FRIGHTEN);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN2,
punit, ptile, NULL)) {
/* "Frighten Hut 2". */
paction = action_by_number(ACTION_HUT_FRIGHTEN2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN3,
punit, ptile, NULL)) {
/* "Frighten Hut 3". */
paction = action_by_number(ACTION_HUT_FRIGHTEN3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN4,
punit, ptile, NULL)) {
/* "Frighten Hut 4". */
paction = action_by_number(ACTION_HUT_FRIGHTEN4);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE,
punit, ptile, NULL)) {
/* "Unit Move". */
paction = action_by_number(ACTION_UNIT_MOVE);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE2,
punit, ptile, NULL)) {
/* "Unit Move 2". */
paction = action_by_number(ACTION_UNIT_MOVE2);
server/scripting/api_server_edit.c
enabled = is_action_enabled_unit_on_units(nmap, paction->id, punit, tgt);
break;
case ATK_TILE:
enabled = is_action_enabled_unit_on_tile(paction->id, punit,
enabled = is_action_enabled_unit_on_tile(nmap, paction->id, punit,
tgt, NULL);
break;
case ATK_EXTRAS:
......
enabled = is_action_enabled_unit_on_units(nmap, paction->id, punit, tgt);
break;
case ATK_TILE:
enabled = is_action_enabled_unit_on_tile(paction->id, punit,
enabled = is_action_enabled_unit_on_tile(nmap, paction->id, punit,
tgt, sub_target);
break;
case ATK_EXTRAS:
server/unithand.c
#define ACTION_PERFORM_UNIT_TILE(action, actor, target, action_performer) \
if (target_tile \
&& is_action_enabled_unit_on_tile(action_type, \
&& is_action_enabled_unit_on_tile(nmap, action_type, \
actor_unit, target_tile, \
target_extra)) { \
bool success; \
......
/*** Phase 2: OK now move the unit ***/
/* This is a regular move, subject to the rules. */
if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE,
if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE,
punit, pdesttile, NULL)) {
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_UNIT_MOVE,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE2,
punit, pdesttile, NULL)) {
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_UNIT_MOVE2,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_UNIT_MOVE3,
punit, pdesttile, NULL)) {
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_UNIT_MOVE3,
......
return unit_perform_action(pplayer, punit->id, ptrans->id,
NO_TARGET, "", ACTION_TRANSPORT_EMBARK3,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK1,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK1,
punit, pdesttile, NULL)) {
/* "Transport Disembark". */
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_TRANSPORT_DISEMBARK1,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK2,
punit, pdesttile, NULL)) {
/* "Transport Disembark 2". */
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_TRANSPORT_DISEMBARK2,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK3,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK3,
punit, pdesttile, NULL)) {
/* "Transport Disembark 3". */
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_TRANSPORT_DISEMBARK3,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK4,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_TRANSPORT_DISEMBARK4,
punit, pdesttile, NULL)) {
/* "Transport Disembark 4". */
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_TRANSPORT_DISEMBARK4,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER,
punit, pdesttile, NULL)) {
/* "Enter Hut". */
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_HUT_ENTER,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_ENTER2,
punit, pdesttile, NULL)) {
/* "Enter Hut 2". */
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_HUT_ENTER2,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN,
punit, pdesttile, NULL)) {
/* "Frighten Hut". */
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_HUT_FRIGHTEN,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN2,
} else if (is_action_enabled_unit_on_tile(nmap, ACTION_HUT_FRIGHTEN2,
punit, pdesttile, NULL)) {
/* "Frighten Hut 2". */
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
(2-2/2)