Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Bug #931099 ยป embark.patch

Sveinung Kvilhaugsvik, 2021-07-23 12:38 AM

View differences:

common/actions.c
case ACTRES_CONQUER_CITY:
/* Reason: "Conquer City" involves moving into the city. */
if (!unit_can_move_to_tile(&(wld.map), actor_unit, target_tile,
FALSE, TRUE)) {
FALSE, FALSE, TRUE)) {
return TRI_NO;
}
......
case ACTRES_CONQUER_EXTRAS:
/* Reason: "Conquer Extras" involves moving to the tile. */
if (!unit_can_move_to_tile(&(wld.map), actor_unit, target_tile,
FALSE, FALSE)) {
FALSE, FALSE, FALSE)) {
return TRI_NO;
}
/* Reason: Must have something to claim. The more specific restriction
......
case ACTRES_TRANSPORT_DISEMBARK:
if (!unit_can_move_to_tile(&(wld.map), actor_unit, target_tile,
FALSE, FALSE)) {
FALSE, FALSE, FALSE)) {
/* Reason: involves moving to the tile. */
return TRI_NO;
}
......
return TRI_NO;
}
if (!unit_can_move_to_tile(&(wld.map), actor_unit, target_tile,
FALSE, FALSE)) {
FALSE, TRUE, FALSE)) {
/* Reason: involves moving to the tile. */
return TRI_NO;
}
......
case ACTRES_HUT_FRIGHTEN:
/* Reason: involves moving to the tile. */
if (!unit_can_move_to_tile(&(wld.map), actor_unit, target_tile,
FALSE, FALSE)) {
FALSE, FALSE, FALSE)) {
return TRI_NO;
}
if (!unit_can_displace_hut(actor_unit, target_tile)) {
......
case ACTRES_UNIT_MOVE:
/* Reason: is moving to the tile. */
if (!unit_can_move_to_tile(&(wld.map), actor_unit, target_tile,
FALSE, FALSE)) {
FALSE, FALSE, FALSE)) {
return TRI_NO;
}
common/movement.c
const struct unit *punit,
const struct tile *dst_tile,
bool igzoc,
bool enter_transport,
bool enter_enemy_city)
{
return (MR_OK == unit_move_to_tile_test(nmap, punit,
punit->activity, unit_tile(punit),
dst_tile, igzoc, NULL,
dst_tile, igzoc,
enter_transport, NULL,
enter_enemy_city));
}
......
enum unit_activity activity,
const struct tile *src_tile,
const struct tile *dst_tile, bool igzoc,
struct unit *embark_to,
bool enter_transport, struct unit *embark_to,
bool enter_enemy_city)
{
bool zoc;
......
return MR_NO_TRANSPORTER_CAPACITY;
}
} else if (!(can_exist_at_tile(nmap, punittype, dst_tile)
|| unit_could_load_at(punit, dst_tile))) {
|| (enter_transport
&& unit_could_load_at(punit, dst_tile)))) {
return MR_NO_TRANSPORTER_CAPACITY;
}
common/movement.h
const struct unit *punit,
const struct tile *ptile,
bool igzoc,
bool enter_transport,
bool enter_enemy_city);
enum unit_move_result
unit_move_to_tile_test(const struct civ_map *nmap,
......
const struct tile *src_tile,
const struct tile *dst_tile,
bool igzoc,
struct unit *embark_to,
bool enter_transport, struct unit *embark_to,
bool enter_enemy_city);
bool can_unit_transport(const struct unit *transporter, const struct unit *transported);
bool can_unit_type_transport(const struct unit_type *transporter,
server/advisors/advgoto.c
enum unit_move_result reason =
unit_move_to_tile_test(&(wld.map), punit, ACTIVITY_IDLE, unit_tile(punit),
dest_tile, unit_has_type_flag(punit, UTYF_IGZOC),
NULL, FALSE);
TRUE, NULL, FALSE);
switch (reason) {
case MR_OK:
server/barbarian.c
int rdir = random_unchecked_direction(land_tiles - checked_count, checked);
if (unit_can_move_to_tile(&(wld.map), punit2, dir_tiles[rdir],
TRUE, FALSE)) {
TRUE, FALSE, FALSE)) {
/* Move */
(void) unit_move_pay(punit2, dir_tiles[rdir]);
log_debug("Moved barbarian unit from (%d, %d) to (%d, %d)",
......
rdir = random_unchecked_direction(land_tiles - checked_count, checked);
if (unit_can_move_to_tile(&(wld.map), punit2, dir_tiles[rdir],
TRUE, FALSE)) {
TRUE, FALSE, FALSE)) {
/* Move */
(void) unit_move_pay(punit2, dir_tiles[rdir]);
dest_found = TRUE;
server/unithand.c
punit->activity,
unit_tile(punit),
city_tile(target_city),
FALSE, NULL, TRUE);
FALSE, FALSE, NULL, TRUE);
} else {
action_custom = MR_OK;
}
......
punit->activity,
unit_tile(punit),
unit_tile(target_unit),
FALSE, NULL, FALSE);
FALSE, TRUE, NULL, FALSE);
} else {
action_custom = MR_OK;
}
......
punit->activity,
unit_tile(punit),
target_tile,
FALSE, NULL, FALSE);
FALSE, FALSE, NULL, FALSE);
} else {
action_custom = MR_OK;
}
......
struct tile *src_tile = unit_tile(punit);
enum unit_move_result reason =
unit_move_to_tile_test(&(wld.map), punit, punit->activity,
src_tile, dest_tile, igzoc, embark_to,
src_tile, dest_tile, igzoc, TRUE, embark_to,
enter_enemy_city);
switch (reason) {
......
if (!move_do_not_act) {
const bool can_not_move = !unit_can_move_to_tile(&(wld.map),
punit, pdesttile,
FALSE, FALSE);
FALSE, FALSE, FALSE);
bool one_action_may_be_legal
= action_tgt_unit(punit, pdesttile, can_not_move)
|| action_tgt_city(punit, pdesttile, can_not_move)
    (1-1/1)