Bug #2496 » 0001-resolve_city_emergency-Disband-an-idle-boat-too-S3_2.patch
| ai/default/daicity.c | ||
|---|---|---|
|
if (city_unhappy(pcity)
|
||
|
&& (utype_happy_cost(unit_type_get(punit), pplayer) > 0
|
||
|
&& (unit_being_aggressive(nmap, punit) || is_field_unit(punit)))
|
||
|
&& def_ai_unit_data(punit, ait)->passenger == 0) {
|
||
|
/* Spare a boat that carries units or that a passenger has
|
||
|
* booked. An unbooked boat's passenger field is negative, not 0,
|
||
|
* so the field alone cannot tell an idle boat from a loaded one. */
|
||
|
&& get_transporter_occupancy(punit) == 0
|
||
|
&& def_ai_unit_data(punit, ait)->passenger <= 0) {
|
||
|
UNIT_LOG(LOG_EMERGENCY, punit, "is causing unrest, disbanded");
|
||
|
/* TODO: If Help Wonder stops blocking Disband Unit there may be
|
||
|
* cases where Disband Unit should be selected. Example: Field unit
|
||