Index: common/map.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.c,v retrieving revision 1.66 diff -u -r1.66 map.c --- map.c 2001/01/25 22:24:58 1.66 +++ map.c 2001/03/08 20:01:25 @@ -1175,10 +1175,10 @@ if (*y < 0 || *y >= map.ysize) return FALSE; + *x %= map.xsize; + if (*x < 0) *x += map.xsize; - else if (*x >= map.xsize) - *x -= map.xsize; return TRUE; } Index: common/map.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.h,v retrieving revision 1.72 diff -u -r1.72 map.h --- map.h 2001/01/25 19:39:37 1.72 +++ map.h 2001/03/08 20:01:25 @@ -189,7 +189,7 @@ void reset_move_costs(int x, int y); #define map_adjust_x(X) \ - (((X)<0) ? (X)+map.xsize : (((X)>=map.xsize) ? (X)-map.xsize : (X))) + (((X)<0) ? ((X) % map.xsize) + map.xsize : ((X) % map.xsize)) #define map_adjust_y(Y) \ (((Y)<0) ? 0 : (((Y)>=map.ysize) ? map.ysize-1 : (Y)))