? auto.rc ? saves Index: ai/aicity.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v retrieving revision 1.120 diff -u -r1.120 aicity.c --- ai/aicity.c 2002/09/02 16:40:17 1.120 +++ ai/aicity.c 2002/09/11 15:34:02 @@ -926,8 +926,10 @@ bool is_valid; if(acity && acity!=pcity && acity->owner==pcity->owner) { - if(acity->x==x && acity->y==y) /* can't stop working city center */ - continue; + if (same_pos(acity->x, acity->y, x, y)) { + /* can't stop working city center */ + continue; + } freelog(LOG_DEBUG, "Availing square in %s", acity->name); is_valid = map_to_city_map(&city_map_x, &city_map_y, acity, x, y); assert(is_valid); Index: ai/aiunit.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v retrieving revision 1.213 diff -u -r1.213 aiunit.c --- ai/aiunit.c 2002/09/03 22:00:07 1.213 +++ ai/aiunit.c 2002/09/11 15:34:02 @@ -344,13 +344,13 @@ if (punit->moves_left > 0) { /* We can still move on... */ - if (punit->x == best_x && punit->y == best_y) { + if (same_pos(punit->x, punit->y, best_x, best_y)) { /* ...and got into desired place. */ return ai_manage_explorer(punit); } else { /* Something went wrong. This should almost never happen. */ - if (punit->x != x || punit->y != y) + if (!same_pos(punit->x, punit->y, x, y)) generate_warmap(map_get_city(punit->x, punit->y), punit); x = punit->x; @@ -522,7 +522,7 @@ if (punit->moves_left > 0) { /* We can still move on... */ - if (punit->x == best_x && punit->y == best_y) { + if (same_pos(punit->x, punit->y, best_x, best_y)) { /* ...and got into desired place. */ return ai_manage_explorer(punit); @@ -1219,7 +1219,7 @@ if (is_ground_unit(punit)) boatid = find_boat(pplayer, &bx, &by, 2); ferryboat = unit_list_find(&(map_get_tile(x, y)->units), boatid); - if (!(dest_x == x && dest_y == y)) { + if (!same_pos(dest_x, dest_y, x, y)) { /* do we require protection? */ d_val = stack_attack_value(dest_x, dest_y); @@ -1355,7 +1355,7 @@ /* in case we need to change */ punit->ai.ai_role = AIUNIT_NONE; /* this can't be right -- Per */ - if (x != punit->x || y != punit->y) { + if (!same_pos(punit->x, punit->y, x, y)) { return 1; /* moved */ } else { return 0; /* didn't move, didn't die */ @@ -1451,7 +1451,8 @@ if (punit->homecity != 0 && (pcity = find_city_by_id(punit->homecity))) { if (pcity->ai.danger != 0) { /* otherwise we can attack */ def = assess_defense(pcity); - if (punit->x == pcity->x && punit->y == pcity->y) { /* I'm home! */ + if (same_pos(punit->x, punit->y, pcity->x, pcity->y)) { + /* I'm home! */ val = assess_defense_unit(pcity, punit, FALSE); def -= val; /* old bad kluge fixed 980803 -- Syela */ /* only the least defensive unit may leave home */ @@ -2746,7 +2747,7 @@ last_x = leader->x; last_y = leader->y; auto_settler_do_goto(pplayer, leader, safest_x, safest_y); - if (leader->x == last_x && leader->y == last_y) { + if (same_pos(leader->x, leader->y, last_x, last_y)) { /* Deep inside the goto handling code, in server/unithand.c::handle_unite_move_request(), the server may decide that a unit is better off not moving this turn, Index: client/climisc.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/climisc.c,v retrieving revision 1.102 diff -u -r1.102 climisc.c --- client/climisc.c 2002/09/10 14:01:05 1.102 +++ client/climisc.c 2002/09/11 15:34:02 @@ -237,7 +237,9 @@ } else { /* calculate before punit disappears, use after punit removed: */ - bool update = (ufocus && ufocus->x==punit->x && ufocus->y==punit->y); + bool update = (ufocus + && same_pos(ufocus->x, ufocus->y, punit->x, punit->y)); + game_remove_unit(punit); punit = NULL; if (update) { Index: client/control.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/control.c,v retrieving revision 1.83 diff -u -r1.83 control.c --- client/control.c 2002/08/24 14:37:33 1.83 +++ client/control.c 2002/09/11 15:34:02 @@ -19,6 +19,7 @@ #include "fcintl.h" #include "log.h" +#include "map.h" #include "mem.h" #include "chatline_g.h" @@ -1265,7 +1266,7 @@ int dest_x, dest_y; draw_line(x, y); get_line_dest(&dest_x, &dest_y); - if (dest_x == x && dest_y == y) { + if (same_pos(dest_x, dest_y, x, y)) { send_goto_route(punit); } else { append_output_window(_("Game: Didn't find a route to the destination!")); @@ -1314,7 +1315,7 @@ int dest_x, dest_y; draw_line(x, y); get_line_dest(&dest_x, &dest_y); - if (dest_x == x && dest_y == y) { + if (same_pos(dest_x, dest_y, x, y)) { send_patrol_route(punit); } else { append_output_window(_("Game: Didn't find a route to the destination!")); Index: client/goto.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/goto.c,v retrieving revision 1.38 diff -u -r1.38 goto.c --- client/goto.c 2002/02/26 19:57:08 1.38 +++ client/goto.c 2002/09/11 15:34:03 @@ -347,7 +347,7 @@ SINGLE_MOVE; move_cost = igter ? MOVE_COST_ROAD : MIN(base_cost, unit_type(punit)->move_rate); - if (src_x != x || src_y != y) { + if (!same_pos(src_x, src_y, x, y)) { /* Attempting to make a path through a sea transporter */ move_cost += MOVE_COST_ROAD; /* Rather arbitrary deterrent */ } @@ -461,7 +461,7 @@ * 0 and the waypoint had our current position, which doesn't seem * too unreasonable. */ - assert(!(old_x == x && old_y == y)); + assert(!same_pos(old_x, old_y, x, y)); dir = get_direction_for_step(old_x, old_y, x, y); @@ -739,12 +739,12 @@ first_index = waypoint_list[waypoint_list_index-1].goto_array_start; - if (x == last_x && y == last_y) + if (same_pos(last_x, last_y, x, y)) return first_index; /* Try to see of we can find this position in the goto array */ for (i = goto_array_index - 1; i >= first_index; i--) { - if (x == goto_array[i].x && y == goto_array[i].y) { + if (same_pos(goto_array[i].x, goto_array[i].y, x, y)) { return i+1; /* found common point */ } } Index: client/packhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v retrieving revision 1.253 diff -u -r1.253 packhand.c --- client/packhand.c 2002/09/10 14:01:05 1.253 +++ client/packhand.c 2002/09/11 15:34:03 @@ -891,7 +891,8 @@ repaint_unit = TRUE; } - if(punit->x!=packet->x || punit->y!=packet->y) { /* change position */ + if (!same_pos(punit->x, punit->y, packet->x, packet->y)) { + /* change position */ struct city *pcity; pcity=map_get_city(punit->x, punit->y); Index: client/gui-gtk/mapctrl.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapctrl.c,v retrieving revision 1.66 diff -u -r1.66 mapctrl.c --- client/gui-gtk/mapctrl.c 2002/08/27 21:15:39 1.66 +++ client/gui-gtk/mapctrl.c 2002/09/11 15:34:03 @@ -341,7 +341,7 @@ get_map_xy(window_x, window_y, &x, &y); get_line_dest(&old_x, &old_y); - if (old_x != x || old_y != y) { + if (!same_pos(old_x, old_y, x, y)) { draw_line(x, y); } } Index: client/gui-gtk-2.0/mapctrl.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapctrl.c,v retrieving revision 1.6 diff -u -r1.6 mapctrl.c --- client/gui-gtk-2.0/mapctrl.c 2002/06/10 02:13:54 1.6 +++ client/gui-gtk-2.0/mapctrl.c 2002/09/11 15:34:03 @@ -333,7 +333,7 @@ get_map_xy(window_x, window_y, &x, &y); get_line_dest(&old_x, &old_y); - if (old_x != x || old_y != y) { + if (!same_pos(old_x, old_y, x, y)) { draw_line(x, y); } } Index: client/gui-mui/mapctrl.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/mapctrl.c,v retrieving revision 1.11 diff -u -r1.11 mapctrl.c --- client/gui-mui/mapctrl.c 2002/03/17 10:48:59 1.11 +++ client/gui-mui/mapctrl.c 2002/09/11 15:34:03 @@ -118,7 +118,7 @@ get_map_xy(window_x, window_y, &x, &y); get_line_dest(&old_x, &old_y); - if (old_x != x || old_y != y) { + if (!same_pos(old_x, old_y, x, y)) { draw_line(x, y); } } Index: client/gui-xaw/mapctrl.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapctrl.c,v retrieving revision 1.55 diff -u -r1.55 mapctrl.c --- client/gui-xaw/mapctrl.c 2002/05/25 16:28:12 1.55 +++ client/gui-xaw/mapctrl.c 2002/09/11 15:34:03 @@ -287,7 +287,7 @@ assert(is_real); get_line_dest(&old_x, &old_y); - if (old_x != x || old_y != y) { + if (!same_pos(old_x, old_y, x, y)) { draw_line(x, y); } } Index: server/autoattack.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/autoattack.c,v retrieving revision 1.37 diff -u -r1.37 autoattack.c --- server/autoattack.c 2002/09/01 19:46:14 1.37 +++ server/autoattack.c 2002/09/11 15:34:03 @@ -80,7 +80,7 @@ range, punit->moves_left, pcity->city_options); square_iterate(punit->x, punit->y, range, x, y) { - if (x == punit->x && y == punit->y) + if (same_pos(punit->x, punit->y, x, y)) continue; if (map_get_city(x, y)) continue; Index: server/sanitycheck.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v retrieving revision 1.22 diff -u -r1.22 sanitycheck.c --- server/sanitycheck.c 2002/02/27 11:12:53 1.22 +++ server/sanitycheck.c 2002/09/11 15:34:03 @@ -107,11 +107,11 @@ } if (pcity) { - assert(pcity->x == x && pcity->y == y); + assert(same_pos(pcity->x, pcity->y, x, y)); } unit_list_iterate(ptile->units, punit) { - assert(punit->x == x && punit->y == y); + assert(same_pos(punit->x, punit->y, x, y)); } unit_list_iterate_end; } whole_map_iterate_end; } Index: server/unithand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v retrieving revision 1.232 diff -u -r1.232 unithand.c --- server/unithand.c 2002/08/14 00:01:58 1.232 +++ server/unithand.c 2002/09/11 15:34:03 @@ -201,7 +201,7 @@ return; } - if(punit->x!=pcity->x || punit->y!=pcity->y) { + if(!same_pos(punit->x, punit->y, pcity->x, pcity->y)) { notify_player(pplayer, _("Game: Illegal move, unit not in city!")); return; } @@ -968,8 +968,8 @@ return FALSE; } - if (punit->activity == ACTIVITY_GOTO && - (dest_x != punit->goto_dest_x || dest_y != punit->goto_dest_y)) { + if (punit->activity == ACTIVITY_GOTO && + !same_pos(punit->goto_dest_x, punit->goto_dest_y, dest_x, dest_y)) { notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT, _("Game: %s aborted GOTO as there are units in the way."), unit_type(punit)->name);