Feature #553 » 0074-AI-Use-ptype-adv.worker-in-dai_manage_unit.patch
| ai/default/daiunit.c | ||
|---|---|---|
|   struct unit_ai *unit_data; | ||
|   struct unit *bodyguard = aiguard_guard_of(ait, punit); | ||
|   bool is_ferry = FALSE; | ||
|   const struct unit_type *ptype; | ||
|   CHECK_UNIT(punit); | ||
| ... | ... | |
|   is_ferry = dai_is_ferry(punit, ait); | ||
|   if (unit_has_type_flag(punit, UTYF_DIPLOMAT)) { | ||
|   ptype = unit_type_get(punit); | ||
|   if (utype_has_flag(ptype, UTYF_DIPLOMAT)) { | ||
|     TIMING_LOG(AIT_DIPLOMAT, TIMER_START); | ||
|     dai_manage_diplomat(ait, pplayer, punit); | ||
|     TIMING_LOG(AIT_DIPLOMAT, TIMER_STOP); | ||
|     return; | ||
|   } else if (unit_has_type_flag(punit, UTYF_WORKERS) | ||
|   } else if (ptype->adv.worker | ||
|              || unit_is_cityfounder(punit)) { | ||
|     dai_manage_settler(ait, pplayer, punit); | ||
|     return; | ||
| ... | ... | |
|     dai_manage_ferryboat(ait, pplayer, punit); | ||
|     TIMING_LOG(AIT_FERRY, TIMER_STOP); | ||
|     return; | ||
|   } else if (utype_fuel(unit_type_get(punit)) | ||
|   } else if (utype_fuel(ptype) | ||
|              && unit_data->task != AIUNIT_ESCORT) { | ||
|     TIMING_LOG(AIT_AIRUNIT, TIMER_START); | ||
|     dai_manage_airunit(ait, pplayer, punit); | ||