diff -Nur -Xfreeciv/diff_ignore rawciv/client/civclient.c freeciv/client/civclient.c --- rawciv/client/civclient.c Wed Apr 25 06:34:41 2001 +++ freeciv/client/civclient.c Mon Aug 27 00:36:08 2001 @@ -540,3 +540,15 @@ void dealloc_id(int id); /* double kludge (suppress a possible warning) */ void dealloc_id(int id) { }/* kludge */ + +/*************************************************************** +Only for use on the client side +***************************************************************/ +enum known_type tile_is_known(int x, int y) +{ + return (enum known_type) (((map.tiles+map_adjust_x(x)+ + map_adjust_y(y)*map.xsize)->known)); +} + + + diff -Nur -Xfreeciv/diff_ignore rawciv/client/civclient.h freeciv/client/civclient.h --- rawciv/client/civclient.h Wed Apr 25 06:34:42 2001 +++ freeciv/client/civclient.h Mon Aug 27 00:36:27 2001 @@ -30,6 +30,8 @@ void client_remove_cli_conn(struct connection *pconn); +enum known_type tile_is_known(int x, int y); + extern int turn_gold_difference; extern int seconds_to_turndone; extern int last_turn_gold_amount; diff -Nur -Xfreeciv/diff_ignore rawciv/client/climisc.c freeciv/client/climisc.c --- rawciv/client/climisc.c Fri Aug 24 08:19:16 2001 +++ freeciv/client/climisc.c Mon Aug 27 00:45:30 2001 @@ -39,6 +39,7 @@ #include "packets.h" #include "support.h" +#include "civclient.h" #include "clinet.h" #include "chatline_g.h" #include "citydlg_g.h" diff -Nur -Xfreeciv/diff_ignore rawciv/client/gui-gtk/citydlg.c freeciv/client/gui-gtk/citydlg.c --- rawciv/client/gui-gtk/citydlg.c Wed Aug 22 06:58:04 2001 +++ freeciv/client/gui-gtk/citydlg.c Mon Aug 27 00:48:08 2001 @@ -51,6 +51,7 @@ #include "wldlg.h" #include "citydlg.h" +#include "civclient.h" #include "cityicon.ico" diff -Nur -Xfreeciv/diff_ignore rawciv/client/tilespec.c freeciv/client/tilespec.c --- rawciv/client/tilespec.c Fri Aug 24 08:19:17 2001 +++ freeciv/client/tilespec.c Mon Aug 27 00:43:28 2001 @@ -42,6 +42,7 @@ #include "support.h" #include "unit.h" +#include "civclient.h" /* for tile_is_known */ #include "control.h" /* for fill_xxx */ #include "graphics_g.h" #include "options.h" /* for fill_xxx */ @@ -891,7 +892,7 @@ if(city_unhappy(pcity)) *sprs++ = sprites.city.disorder; - if(ptile->known==TILE_KNOWN_FOGGED && draw_fog_of_war) + if(tile_is_known(pcity->x, pcity->y)==TILE_KNOWN_FOGGED && draw_fog_of_war) *sprs++ = sprites.tx.fog; /* Put the size sprites last, so that they are not obscured @@ -1083,7 +1084,7 @@ return -1; ptile = map_get_tile(x, y); - if (!ptile->known) + if (!tile_is_known(x, y)) return -1; pcity = ptile->city; @@ -1303,7 +1304,7 @@ ptile=map_get_tile(abs_x0, abs_y0); - if(abs_y0>=map.ysize || ptile->known == TILE_UNKNOWN) { + if(abs_y0>=map.ysize || tile_is_known(abs_x0, abs_y0) == TILE_UNKNOWN) { return 0; } @@ -1527,7 +1528,7 @@ if(tspecial & S_AIRBASE && draw_fortress_airbase) *sprs++ = sprites.tx.airbase; if(tspecial & S_POLLUTION && draw_pollution) *sprs++ = sprites.tx.pollution; if(tspecial & S_FALLOUT && draw_pollution) *sprs++ = sprites.tx.fallout; - if(ptile->known==TILE_KNOWN_FOGGED && draw_fog_of_war) *sprs++ = sprites.tx.fog; + if(tile_is_known(abs_x0, abs_y0)==TILE_KNOWN_FOGGED && draw_fog_of_war) *sprs++ = sprites.tx.fog; if(!citymode) { tileno = INDEX_NSEW((tile_is_known(abs_x0, abs_y0-1)==TILE_UNKNOWN), @@ -1716,7 +1717,7 @@ struct unit *punit; struct city *pcity; - if(!ptile->known) { + if(!tile_is_known(x, y)) { color=COLOR_STD_BLACK; } else if((pcity=map_get_city(x, y))) { if(pcity->owner==game.player_idx) diff -Nur -Xfreeciv/diff_ignore rawciv/common/map.c freeciv/common/map.c --- rawciv/common/map.c Wed Aug 22 06:58:12 2001 +++ freeciv/common/map.c Mon Aug 27 00:35:21 2001 @@ -1249,16 +1249,6 @@ (map.tiles+map_adjust_x(x)+map_adjust_y(y)*map.xsize)->city=pcity; } - -/*************************************************************** -Only for use on the client side -***************************************************************/ -enum known_type tile_is_known(int x, int y) -{ - return (enum known_type) (((map.tiles+map_adjust_x(x)+ - map_adjust_y(y)*map.xsize)->known)); -} - /*************************************************************** Are (x1,y1) and (x2,y2) really the same when adjusted? This function might be necessary ALOT of places... diff -Nur -Xfreeciv/diff_ignore rawciv/common/map.h freeciv/common/map.h --- rawciv/common/map.h Mon Aug 20 07:01:31 2001 +++ freeciv/common/map.h Mon Aug 27 00:36:58 2001 @@ -211,7 +211,6 @@ void map_set_special(int x, int y, enum tile_special_type spe); void map_clear_special(int x, int y, enum tile_special_type spe); void tile_init(struct tile *ptile); -enum known_type tile_is_known(int x, int y); int check_coords(int *x, int *y); int is_real_tile(int x, int y); int normalize_map_pos(int *x, int *y);