Index: ai/aiunit.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v retrieving revision 1.325 diff -u -r1.325 aiunit.c --- ai/aiunit.c 7 Aug 2004 17:53:50 -0000 1.325 +++ ai/aiunit.c 11 Aug 2004 20:45:42 -0000 @@ -1036,7 +1036,7 @@ return; } - if (q > 0 && pcity->ai.urgency > 0) { + if (pcity && q > 0 && pcity->ai.urgency > 0) { ai_unit_new_role(punit, AIUNIT_DEFEND_HOME, pcity->x, pcity->y); return; } @@ -1067,7 +1067,7 @@ generate_warmap(map_get_city(punit->x, punit->y), punit); /* I need this in order to call unit_move_turns, here and in look_for_charge */ - if (q > 0) { + if (pcity && q > 0) { q *= 100; q /= unit_def_rating_basic_sq(punit); q >>= unit_move_turns(punit, pcity->x, pcity->y); @@ -1082,7 +1082,7 @@ */ val = look_for_charge(pplayer, punit, &aunit, &acity); } - if (q > val) { + if (pcity && q > val) { ai_unit_new_role(punit, AIUNIT_DEFEND_HOME, pcity->x, pcity->y); return; }