diff server/citytools.c server/citytools.c --- server/citytools.c Tue Aug 8 16:54:16 2000 +++ server/citytools.c Fri Aug 11 13:54:39 2000 @@ -217,12 +217,14 @@ plr = city_owner(pcity); i = city_get_food_tile(x, y, pcity); - if (foodneed > 0) i += 9 * (MIN(i, foodneed)); + if (foodneed > 0) i += 9 * (MIN(i, foodneed)) + 4 * (MIN(i,1)); /* *= 10 led to stupidity with foodneed = 1, mine, and farmland -- Syela */ + else if (foodneed == 0) i += 4 * (MIN(i,1)); i *= food_weighting(MAX(2,pcity->size)); j = city_get_shields_tile(x, y, pcity); - if (prodneed > 0) j += 9 * (MIN(j, prodneed)); + if (prodneed > 0) j += 9 * (MIN(j, prodneed)) + 4 * (MIN(j,1)); + else if (prodneed == 0) j += 4 * (MIN(j,1)); j *= SHIELD_WEIGHTING * city_shield_bonus(pcity); j /= 100; @@ -242,7 +244,7 @@ int worst = 0, tmp; city_map_iterate(x, y) { if ((x != 2 || y != 2) && get_worker_city(pcity, x, y) == C_TILE_WORKER) { - tmp = city_tile_value(pcity, x, y, 0, 0); + tmp = city_tile_value(pcity, x, y, -1, -1); if (tmp < worst || !worst) worst = tmp; } } @@ -260,7 +262,7 @@ if ((x == 2 || y == 2) || (get_worker_city(pcity, x, y) == C_TILE_WORKER) || can_place_worker_here(pcity, x, y)) { - tmp = city_tile_value(pcity, x, y, 0, 0); + tmp = city_tile_value(pcity, x, y, -1, -1); if (tmp < best || !best) best = tmp; } } diff server/settlers.c server/settlers.c --- server/settlers.c Tue Aug 8 10:24:41 2000 +++ server/settlers.c Fri Aug 11 13:54:39 2000 @@ -487,7 +487,7 @@ x = pcity->x + i - 2; y = pcity->y + j - 2; if (!(map_get_special(x, y) & S_POLLUTION)) return(-1); map_clear_special(x, y, S_POLLUTION); - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); map_set_special(x, y, S_POLLUTION); m = (m + best + 50) * 2; return(m); @@ -503,7 +503,7 @@ x = pcity->x + i - 2; y = pcity->y + j - 2; if (!(map_get_special(x, y) & S_FALLOUT)) return(-1); map_clear_special(x, y, S_FALLOUT); - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); map_set_special(x, y, S_FALLOUT); if (!pplayer->ai.control) m = (m + best + 50) * 2; @@ -545,7 +545,7 @@ return -1; ptile->terrain = type->irrigation_result; map_clear_special(x, y, S_MINE); - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); ptile->terrain = t; ptile->special = s; return(m); @@ -555,7 +555,7 @@ (is_wet(pplayer,x,y) || is_wet(pplayer,x,y-1) || is_wet(pplayer,x,y+1) || is_wet(pplayer,x-1,y) || is_wet(pplayer,x+1,y)))) { map_set_special(x, y, S_IRRIGATION); - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); map_clear_special(x, y, S_IRRIGATION); return(m); } else if((ptile->terrain==type->irrigation_result && @@ -565,7 +565,7 @@ (is_wet(pplayer,x,y) || is_wet(pplayer,x,y-1) || is_wet(pplayer,x,y+1) || is_wet(pplayer,x-1,y) || is_wet(pplayer,x+1,y)))) { map_set_special(x, y, S_FARMLAND); - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); map_clear_special(x, y, S_FARMLAND); return(m); } else return(-1); @@ -589,7 +589,7 @@ ptile->terrain = type->mining_result; map_clear_special(x, y, S_FARMLAND); map_clear_special(x, y, S_IRRIGATION); - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); ptile->terrain = t; ptile->special = s; return(m); @@ -599,7 +599,7 @@ if ((ptile->terrain == T_HILLS || ptile->terrain == T_MOUNTAINS) && !(ptile->special&S_IRRIGATION) && !(ptile->special&S_MINE)) { map_set_special(x, y, S_MINE); - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); map_clear_special(x, y, S_MINE); return(m); } else return(-1); @@ -634,7 +634,7 @@ map_clear_special(x, y, S_IRRIGATION); } - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); ptile->terrain = t; ptile->special = s; return(m); @@ -694,7 +694,7 @@ player_knows_techs_with_flag(pplayer, TF_BRIDGE)) && !(ptile->special&S_ROAD)) { ptile->special|=S_ROAD; /* have to do this to avoid reset_move_costs -- Syela */ - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); ptile->special&=~S_ROAD; return(m); } else return(-1); @@ -717,7 +717,7 @@ !(ptile->special&S_RAILROAD)) { spe_sav = ptile->special; ptile->special|=(S_ROAD | S_RAILROAD); - m = city_tile_value(pcity, i, j, 0, 0); + m = city_tile_value(pcity, i, j, -1, -1); ptile->special = spe_sav; return(m); } else return(-1); @@ -963,7 +963,7 @@ for obvious reasons; structure is much the same as it once was but subroutines are not -- Syela */ mv_turns = (warmap.cost[x][y]) / mv_rate; - oldv = city_tile_value(pcity, i, j, 0, 0); + oldv = city_tile_value(pcity, i, j, -1, -1); /* now, consider various activities... */