? civscore.log ? void_tile_remove.diff Index: TODO =================================================================== RCS file: /home/freeciv/CVS/freeciv/TODO,v retrieving revision 1.11 diff -u -r1.11 TODO --- TODO 2001/07/15 21:34:10 1.11 +++ TODO 2001/09/23 19:49:46 @@ -48,7 +48,6 @@ the right places. Note that the AI in various places do not adjust tiles properly even for the current numbering scheme. - It vould also be nice to get rid of the void_tile kludge. Note that the conversion is backwards compatible, so it can be done in small steps. No mega-patches please. Index: common/map.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.c,v retrieving revision 1.90 diff -u -r1.90 map.c --- common/map.c 2001/09/23 16:09:39 1.90 +++ common/map.c 2001/09/23 19:49:52 @@ -34,9 +34,6 @@ /* the very map */ struct civ_map map; -/* this is used for map yval out of range: */ -static struct tile void_tile; - /* these are initialized from the terrain ruleset */ struct terrain_misc terrain_control; struct tile_type tile_types[T_LAST]; @@ -175,7 +172,6 @@ /*************************************************************** put some sensible values into the map structure - Also initialize special void_tile. ***************************************************************/ void map_init(void) { @@ -200,8 +196,6 @@ map.have_specials = 0; map.have_rivers_overlay = 0; map.have_huts = 0; - - tile_init(&void_tile); } /************************************************************************** @@ -1015,8 +1009,7 @@ /*************************************************************** Similar to tile_move_cost_ptrs, but for pre-calculating tile->move_cost[] values for use by ai (?) - If either terrain is T_UNKNOWN (only void_tile, note this - is different to tile->known), then return 'maxcost'. + If either terrain is T_UNKNOWN, then return 'maxcost'. If both are ocean, or one is ocean and other city, return -3, else if either is ocean return maxcost. Otherwise, return normal cost (unit-independent). @@ -1090,11 +1083,6 @@ void initialize_move_costs(void) { int maxcost = 72; /* should be big enough without being TOO big */ - int dir; - - for (dir = 0; dir < 8; dir++) { - void_tile.move_cost[dir] = maxcost; - } whole_map_iterate(x, y) { struct tile *tile0, *tile1; @@ -1155,10 +1143,11 @@ ***************************************************************/ struct tile *map_get_tile(int x, int y) { - if (!normalize_map_pos(&x, &y)) - return &void_tile; /* accurate fix by Syela */ - else - return map.tiles + map_inx(x, y); + int is_real = normalize_map_pos(&x, &y); + + assert(is_real); + + return map.tiles + map_inx(x, y); } /***************************************************************