void CvUnitAI::AI_workerMove()
{
PROFILE_FUNC();
CvCity* pCity;
bool bCanRoute;
bool bNextCity;
bCanRoute = canBuildRoute();
bNextCity = false;
// XXX could be trouble...
if (!getGroup()->canDefend() && plot()->getOwnerINLINE() != getOwnerINLINE())
{
if (AI_retreatToCity())
{
return;
}
}
if (!isHuman())
{
if (plot()->getOwnerINLINE() == getOwnerINLINE())
{
if (AI_load(UNITAI_SETTLER_SEA, MISSIONAI_LOAD_SETTLER, UNITAI_SETTLE, 2, -1, -1, 0, MOVE_SAFE_TERRITORY))
{
return;
}
}
}
if (!(getGroup()->canDefend()))
{
if (GET_PLAYER(getOwnerINLINE()).AI_isPlotThreatened(plot(), 2))
{
if (AI_retreatToCity()) // XXX maybe not do this??? could be working productively somewhere else...
{
return;
}
}
}