diff -Nurd -X freeciv.current/diff_ignore work.clean/common/map.c work.normalize/common/map.c --- work.clean/common/map.c Sun Aug 26 11:28:16 2001 +++ work.normalize/common/map.c Sun Sep 2 23:54:50 2001 @@ -1298,6 +1298,7 @@ return 0 <= y && y < map.ysize; } +#if 0 /************************************************************************** Normalizes the map position. Returns TRUE if it is valid, false otherwise. **************************************************************************/ @@ -1312,6 +1313,7 @@ return TRUE; } +#endif /************************************************************************** Random neighbouring square. diff -Nurd -X freeciv.current/diff_ignore work.clean/common/map.h work.normalize/common/map.h --- work.clean/common/map.h Sun Aug 26 11:28:17 2001 +++ work.normalize/common/map.h Sun Sep 2 23:54:13 2001 @@ -570,4 +570,6 @@ #define MAP_MIN_GENERATOR 1 #define MAP_MAX_GENERATOR 4 +#include "map_inline.h" + #endif /* FC__MAP_H */ diff -Nurd -X freeciv.current/diff_ignore work.clean/common/map_inline.h work.normalize/common/map_inline.h --- work.clean/common/map_inline.h Thu Jan 1 01:00:00 1970 +++ work.normalize/common/map_inline.h Sun Sep 2 23:55:05 2001 @@ -0,0 +1,15 @@ + +/************************************************************************** +Normalizes the map position. Returns TRUE if it is valid, false otherwise. +**************************************************************************/ +extern inline int normalize_map_pos(int *x, int *y) { + if (*y < 0 || *y >= map.ysize) + return FALSE; + + while (*x < 0) + *x += map.xsize; + while (*x >= map.xsize) + *x -= map.xsize; + + return TRUE; +}