diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/ai/aicity.c bugs/ai/aicity.c --- ../freeciv-cvs/ai/aicity.c Thu Oct 4 22:23:31 2001 +++ bugs/ai/aicity.c Mon Dec 17 00:26:34 2001 @@ -937,7 +937,8 @@ **************************************************************************/ static void make_taxmen(struct city *pcity) { - while (!city_unhappy(pcity) && pcity->ppl_elvis) { + while (!city_unhappy(pcity) && pcity->ppl_elvis && + can_change_specialist(pcity)) { pcity->ppl_taxman++; pcity->ppl_elvis--; city_refresh(pcity); diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/client/packhand.c bugs/client/packhand.c --- ../freeciv-cvs/client/packhand.c Sat Dec 15 16:15:24 2001 +++ bugs/client/packhand.c Sun Dec 16 23:56:44 2001 @@ -1578,7 +1578,8 @@ game.aqueduct_size = packet->aqueduct_size; game.sewer_size = packet->sewer_size; game.add_to_size_limit = packet->add_to_size_limit; - + game.choose_specialist_min = packet->choose_specialist_min; + game.rtech.cathedral_plus = packet->rtech.cathedral_plus; game.rtech.cathedral_minus = packet->rtech.cathedral_minus; game.rtech.colosseum_plus = packet->rtech.colosseum_plus; diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/common/city.c bugs/common/city.c --- ../freeciv-cvs/common/city.c Fri Oct 26 10:07:18 2001 +++ bugs/common/city.c Mon Dec 17 00:35:55 2001 @@ -357,6 +357,19 @@ } /************************************************************************** + Is the city allowed to change the occupation of a specialist? + Otherwise only elvises can be employed. + Note that this applies to the ai as well. -- Gregor +**************************************************************************/ +boolean can_change_specialist(struct city *pcity) +{ + if (pcity->size >= game.choose_specialist_min) + return true; + else + return false; +} + +/************************************************************************** Could this improvment be built in the city, without checking if the owner has the required tech, but if all other pre reqs are fulfiled? modularized so the AI can choose the tech it wants -- Syela diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/common/city.h bugs/common/city.h --- ../freeciv-cvs/common/city.h Fri Oct 26 10:07:19 2001 +++ bugs/common/city.h Sun Dec 16 23:46:38 2001 @@ -320,7 +320,8 @@ int can_build_unit(struct city *pcity, Unit_Type_id id); int can_build_unit_direct(struct city *pcity, Unit_Type_id id); int can_eventually_build_unit(struct city *pcity, Unit_Type_id id); -int city_got_building(struct city *pcity, Impr_Type_id id); +int can_change_specialist(struct city *pcity); +int city_got_building(struct city *pcity, Impr_Type_id id); int city_affected_by_wonder(struct city *pcity, Impr_Type_id id); int city_got_effect(struct city *pcity, Impr_Type_id id); int city_got_citywalls(struct city *pcity); diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/common/game.h bugs/common/game.h --- ../freeciv-cvs/common/game.h Sat Dec 15 16:15:34 2001 +++ bugs/common/game.h Sun Dec 16 23:56:44 2001 @@ -120,6 +120,7 @@ int aqueduct_size; int sewer_size; int add_to_size_limit; + int choose_specialist_min; int savepalace; int spacerace; int turnblock; diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/common/packets.c bugs/common/packets.c --- ../freeciv-cvs/common/packets.c Mon Dec 10 23:17:44 2001 +++ bugs/common/packets.c Sun Dec 16 23:56:44 2001 @@ -2874,6 +2874,7 @@ cptr=put_uint8(cptr, packet->aqueduct_size); cptr=put_uint8(cptr, packet->sewer_size); cptr=put_uint8(cptr, packet->add_to_size_limit); + cptr=put_uint8(cptr, packet->choose_specialist_min); if (pc && !has_capability("new_bonus_tech", pc->capability)) { cptr = put_uint8(cptr, packet->rtech.get_bonus_tech); @@ -2917,6 +2918,7 @@ iget_uint8(&iter, &packet->aqueduct_size); iget_uint8(&iter, &packet->sewer_size); iget_uint8(&iter, &packet->add_to_size_limit); + iget_uint8(&iter, &packet->choose_specialist_min); if (pc && !has_capability("new_bonus_tech", pc->capability)) { iget_uint8(&iter, &packet->rtech.get_bonus_tech); diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/common/packets.h bugs/common/packets.h --- ../freeciv-cvs/common/packets.h Thu Oct 18 18:45:33 2001 +++ bugs/common/packets.h Sun Dec 16 23:56:44 2001 @@ -553,6 +553,7 @@ int aqueduct_size; int sewer_size; int add_to_size_limit; + int choose_specialist_min; int num_unit_types; int num_impr_types; int num_tech_types; diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/common/shared.h bugs/common/shared.h --- ../freeciv-cvs/common/shared.h Sat Sep 15 23:25:12 2001 +++ bugs/common/shared.h Mon Dec 17 00:22:23 2001 @@ -39,6 +39,15 @@ #define FALSE (0) #endif +#ifndef true +#define true (1) +#endif +#ifndef false +#define false (0) +#endif + +typedef int boolean; + #ifndef MAX #define MAX(x,y) (((x)>(y))?(x):(y)) #define MIN(x,y) (((x)<(y))?(x):(y)) diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/data/default/cities.ruleset bugs/data/default/cities.ruleset --- ../freeciv-cvs/data/default/cities.ruleset Fri May 25 00:12:09 2001 +++ bugs/data/default/cities.ruleset Sun Dec 16 23:56:44 2001 @@ -13,6 +13,7 @@ [parameters] add_to_size_limit = 8 ; cities >= this cannot be added to. +choose_specialist_min = 3 ; cities >= can change to taxmen or elvies ; ; City styles define the way cities are drawn diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/server/cityhand.c bugs/server/cityhand.c --- ../freeciv-cvs/server/cityhand.c Mon Dec 10 23:18:18 2001 +++ bugs/server/cityhand.c Mon Dec 17 00:02:06 2001 @@ -78,17 +78,23 @@ if(!player_owns_city(pplayer, pcity)) return; if(preq->specialist_from==SP_ELVIS) { - if(pcity->size<5) + if(!can_change_specialist(pcity)) return; if(!pcity->ppl_elvis) return; pcity->ppl_elvis--; } else if(preq->specialist_from==SP_TAXMAN) { + if(!can_change_specialist(pcity)) + return; + if (!pcity->ppl_taxman) return; pcity->ppl_taxman--; } else if (preq->specialist_from==SP_SCIENTIST) { + if(!can_change_specialist(pcity)) + return; + if (!pcity->ppl_scientist) return; pcity->ppl_scientist--; diff -ruN -X ../patch/diff_ignore ../freeciv-cvs/server/ruleset.c bugs/server/ruleset.c --- ../freeciv-cvs/server/ruleset.c Mon Dec 10 23:18:18 2001 +++ bugs/server/ruleset.c Mon Dec 17 00:24:25 2001 @@ -1683,6 +1683,7 @@ packet.aqueduct_size = game.aqueduct_size; packet.sewer_size = game.sewer_size; packet.add_to_size_limit = game.add_to_size_limit; + packet.choose_specialist_min = game.choose_specialist_min; /* when removing the new_bonus_tech capability remove the following line; has_capability("new_bonus_tech", */ @@ -2120,7 +2121,9 @@ /* City Parameters */ game.add_to_size_limit = - secfile_lookup_int_default(file, 9, "parameters.add_to_size_limit"); + secfile_lookup_int_default(file, 8, "parameters.add_to_size_limit"); + game.choose_specialist_min = + secfile_lookup_int_default(file, 5, "parameters.choose_specialist_min"); /* City Styles ... */