Index: ai/aiunit.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v retrieving revision 1.317 diff -u -r1.317 aiunit.c --- ai/aiunit.c 4 Jun 2004 15:25:13 -0000 1.317 +++ ai/aiunit.c 11 Jun 2004 14:23:23 -0000 @@ -1473,12 +1473,13 @@ if (same_pos(punit->x, punit->y, pcity->x, pcity->y)) { UNIT_LOG(LOG_DEBUG, punit, "go home successful; role AI_NONE"); ai_unit_new_role(punit, AIUNIT_NONE, -1, -1); + /* aggro defense goes here -- Syela */ /* Attack anything that won't kill us */ (void) ai_military_rampage(punit, RAMPAGE_ANYTHING, RAMPAGE_ANYTHING); } else { - (void) ai_unit_goto(punit, pcity->x, pcity->y); + (void) ai_gothere(pplayer, punit, pcity->x, pcity->y); } } } @@ -2793,7 +2833,13 @@ ai_manage_military(pplayer,punit); return; } else { - (void) ai_manage_explorer(punit); /* what else could this be? -- Syela */ + int id = punit->id; + /* what else could this be? -- Syela */ + if (!ai_manage_explorer(punit) + && find_unit_by_id(id)) { + ai_unit_new_role(punit, AIUNIT_DEFEND_HOME, -1, -1); + ai_military_gohome(pplayer, punit); + } return; } }