[Freeciv-Dev] (PR#4603) bug in update_dumb_city (occupied flag)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I made this bug...since the pcity's occupied flag isn't used *at all* at
the server end (is there some way we can #if 0 it out?), trying to use
it isn't a good idea. This could cause generally inconsistent behavior
of the occupied flag all over the place at the client end...
Reported by valgrind.
jason
Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.221
diff -u -r1.221 citytools.c
--- server/citytools.c 2003/07/17 16:42:59 1.221
+++ server/citytools.c 2003/07/18 06:43:00
@@ -1641,13 +1641,15 @@
struct player_tile *plrtile = map_get_player_tile(pcity->x, pcity->y,
pplayer);
struct dumb_city *pdcity = plrtile->city;
-
+ bool occupied =
+ (unit_list_size(&(map_get_tile(pcity->x, pcity->y)->units)) > 0);
+
if (pdcity
&& pdcity->id == pcity->id
&& strcmp(pdcity->name, pcity->name) == 0
&& pdcity->size == pcity->size
&& pdcity->has_walls == city_got_citywalls(pcity)
- && pdcity->occupied == pcity->occupied
+ && pdcity->occupied == occupied
&& pdcity->owner == pcity->owner) {
return FALSE;
}
@@ -1664,8 +1666,7 @@
sz_strlcpy(pdcity->name, pcity->name);
pdcity->size = pcity->size;
pdcity->has_walls = city_got_citywalls(pcity);
- pdcity->occupied =
- (unit_list_size(&(map_get_tile(pcity->x, pcity->y)->units)) > 0);
+ pdcity->occupied = occupied;
pdcity->owner = pcity->owner;
return TRUE;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#4603) bug in update_dumb_city (occupied flag),
Jason Short <=
|
|