Project

General

Profile

Feature #792 » 0008-Unhardcode-wld.map-from-can_unit_alight_or_be_unload.patch

S3_1 - Marko Lindqvist, 08/16/2024 08:53 PM

View differences:

common/movement.c
return FALSE;
case TDT_ALIGHT:
return can_unit_exist_at_tile(nmap, punit, unit_tile(punit))
&& can_unit_alight_or_be_unloaded(punit, ptrans);
&& can_unit_alight_or_be_unloaded(nmap, punit, ptrans);
}
fc_assert(FALSE);
common/unit.c
Return TRUE iff the given unit can leave its current transporter without
doing any other action or move.
**************************************************************************/
bool can_unit_alight_or_be_unloaded(const struct unit *pcargo,
bool can_unit_alight_or_be_unloaded(const struct civ_map *nmap,
const struct unit *pcargo,
const struct unit *ptrans)
{
const struct civ_map *nmap = &(wld.map);
if (!pcargo || !ptrans) {
return FALSE;
}
common/unit.h
bool could_unit_load(const struct unit *pcargo, const struct unit *ptrans);
bool can_unit_load(const struct unit *punit, const struct unit *ptrans);
bool can_unit_unload(const struct unit *punit, const struct unit *ptrans);
bool can_unit_alight_or_be_unloaded(const struct unit *pcargo,
bool can_unit_alight_or_be_unloaded(const struct civ_map *nmap,
const struct unit *pcargo,
const struct unit *ptrans);
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit);
bool can_unit_change_homecity_to(const struct unit *punit,
(2-2/2)