Index: server/maphand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/maphand.c,v retrieving revision 1.46 diff -u -r1.46 maphand.c --- maphand.c 2000/06/13 13:54:59 1.46 +++ maphand.c 2000/06/21 21:03:48 @@ -716,18 +716,6 @@ /************************************************************************** ... **************************************************************************/ -void teleport_unit_sight_points(int src_x, int src_y, int dest_x, int dest_y, - struct unit* punit) -{ - struct player *pplayer = &game.players[punit->owner]; - int range = get_unit_type(punit->type)->vision_range; - unfog_area(pplayer,dest_x,dest_y,range); - fog_area(pplayer,src_x,src_y,range); -} - -/************************************************************************** -... -**************************************************************************/ void map_fog_city_area(struct city *pcity) { if (!pcity) { Index: server/maphand.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/maphand.h,v retrieving revision 1.15 diff -u -r1.15 maphand.h --- maphand.h 2000/06/09 11:57:01 1.15 +++ maphand.h 2000/06/21 21:03:49 @@ -49,8 +49,6 @@ void map_tiles_load(struct section_file *file); void map_load(struct section_file *file); void map_rivers_overlay_load(struct section_file *file); -void teleport_unit_sight_points(int src_x, int src_y, int dest_x, int dest_y, - struct unit* punit); void map_fog_city_area(struct city *pcity); void map_unfog_city_area(struct city *pcity); void remove_unit_sight_points(struct unit *punit); Index: server/unitfunc.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/unitfunc.c,v retrieving revision 1.183 diff -u -r1.183 unitfunc.c --- unitfunc.c 2000/06/21 15:56:52 1.183 +++ unitfunc.c 2000/06/21 21:04:05 @@ -3383,7 +3383,6 @@ if (punit->homecity) homecity = find_city_by_id(punit->homecity); - teleport_unit_sight_points(src_x, src_y, dest_x, dest_y, punit); wakeup_neighbor_sentries(pplayer, dest_x, dest_y); maybe_make_first_contact(dest_x, dest_y, punit->owner); @@ -3463,6 +3462,7 @@ If you move a unit you should always use this function, as it also sets the transported_by unit field correctly. take_from_land is only relevant if you have set transport_units. +Note that the src and dest need not be adjacent. **************************************************************************/ int move_unit(struct unit *punit, const int dest_x, const int dest_y, int transport_units, int take_from_land, int move_cost) @@ -3505,8 +3505,8 @@ pcargo->transported_by = -1; } unit_list_iterate_end; - /* The way we first make a list of the units to be moved with a transporter - and then we insert them again. The way this is done makes sure that the + /* Transporting units. We first make a list of the units to be moved and + then insert them again. The way this is done makes sure that the units stay in the same order. */ if (get_transporter_capacity(punit) && transport_units) { struct unit_list cargo_units; @@ -3523,16 +3523,24 @@ /* Insert them again. */ unit_list_iterate(cargo_units, pcargo) { + unfog_area(pplayer, dest_x, dest_y, get_unit_type(pcargo->type)->vision_range); pcargo->x = dest_x; pcargo->y = dest_y; unit_list_insert(&pdesttile->units, pcargo); check_unit_activity(pcargo); send_unit_info_to_onlookers(0, pcargo, src_x, src_y, 1, 0); + fog_area(pplayer, src_x, src_y, get_unit_type(pcargo->type)->vision_range); handle_unit_move_consequences(pcargo, src_x, src_y, dest_x, dest_y); } unit_list_iterate_end; unit_list_unlink_all(&cargo_units); } + /* We first unfog the destination, then move the unit and send the move, + and then fog the old territory. This means that the player gets a chance to + see the newly explored territory while the client moves the unit, and both + areas are visible during the move */ + unfog_area(pplayer, dest_x, dest_y, get_unit_type(punit->type)->vision_range); + unit_list_unlink(&psrctile->units, punit); punit->x = dest_x; punit->y = dest_y; @@ -3549,6 +3557,7 @@ set_unit_activity(punit, ACTIVITY_SENTRY); } send_unit_info_to_onlookers(0, punit, src_x, src_y, 0, 0); + fog_area(pplayer, src_x, src_y, get_unit_type(punit->type)->vision_range); handle_unit_move_consequences(punit, src_x, src_y, dest_x, dest_y);