Index: client/control.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/control.h,v retrieving revision 1.28 diff -u -r1.28 control.h --- client/control.h 2002/03/17 09:11:51 1.28 +++ client/control.h 2002/07/09 00:13:01 @@ -87,7 +87,7 @@ void set_unit_focus(struct unit *punit); void set_unit_focus_no_center(struct unit *punit); void set_unit_focus_and_select(struct unit *punit); -void update_unit_focus(void); +void update_unit_focus(struct unit *punit); struct unit *find_visible_unit(struct tile *ptile); void set_units_in_combat(struct unit *pattacker, struct unit *pdefender); void blink_active_unit(void); Index: client/civclient.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/civclient.c,v retrieving revision 1.138 diff -u -r1.138 civclient.c --- client/civclient.c 2002/06/27 01:11:37 1.138 +++ client/civclient.c 2002/07/09 00:13:01 @@ -576,7 +576,7 @@ update_research(game.player_ptr); role_unit_precalcs(); boot_help_texts(); /* reboot */ - update_unit_focus(); + update_unit_focus(NULL); } else if(client_state==CLIENT_PRE_GAME_STATE) { popdown_all_city_dialogs(); Index: client/control.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/control.c,v retrieving revision 1.81 diff -u -r1.81 control.c --- client/control.c 2002/06/06 07:26:04 1.81 +++ client/control.c 2002/07/09 00:13:02 @@ -156,9 +156,10 @@ If there is no unit currently in focus, or if the current unit in focus should not be in focus, then get a new focus unit. We let GOTO-ing units stay in focus, so that if they have moves left -at the end of the goto, then they are still in focus. +at the end of the goto, then they are still in focus. punit is previous +unit, and should most often be NULL. **************************************************************************/ -void update_unit_focus(void) +void update_unit_focus(struct unit *punit) { if(!punit_focus || (punit_focus->activity!=ACTIVITY_IDLE @@ -166,6 +167,10 @@ || punit_focus->moves_left==0 || punit_focus->ai.control) { advance_unit_focus(); + } else if (punit_focus && punit && punit->activity==ACTIVITY_EXPLORE + && punit->moves_left==0) { + /* kludge for auto-exploring units taking viewpoint away */ + center_tile_mapcanvas(punit_focus->x, punit_focus->y); } } Index: client/packhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v retrieving revision 1.245 diff -u -r1.245 packhand.c --- client/packhand.c 2002/07/03 08:05:06 1.245 +++ client/packhand.c 2002/07/09 00:13:02 @@ -288,7 +288,7 @@ player_set_unit_focus_status(game.player_ptr); update_info_label(); /* get initial population right */ - update_unit_focus(); + update_unit_focus(NULL); update_unit_info_label(get_unit_in_focus()); /* Find something sensible to display instead of the intro gfx. */ @@ -663,7 +663,7 @@ update_info_label(); player_set_unit_focus_status(game.player_ptr); - update_unit_focus(); + update_unit_focus(NULL); auto_center_on_focus_unit(); update_unit_info_label(get_unit_in_focus()); @@ -912,7 +912,7 @@ if(tile_get_known(packet->x, packet->y) == TILE_KNOWN) { do_move_unit(punit, packet); - update_unit_focus(); + update_unit_focus(punit); } else { do_move_unit(punit, packet); /* nice to see where a unit is going */ @@ -1021,7 +1021,7 @@ if(packet->select_it && (punit->owner==game.player_idx)) { set_unit_focus_and_select(punit); } else { - update_unit_focus(); + update_unit_focus(punit); } } @@ -1121,7 +1121,7 @@ boot_help_texts(); /* reboot, after setting game.spacerace */ } - update_unit_focus(); + update_unit_focus(NULL); } /**************************************************************************