diff -ur -Xfreeciv/diff_ignore freeciv/ai/advdomestic.c freeciv-mod/ai/advdomestic.c --- freeciv/ai/advdomestic.c Thu May 11 00:44:46 2000 +++ freeciv-mod/ai/advdomestic.c Thu May 11 00:54:42 2000 @@ -403,7 +403,7 @@ /* military advisor will deal with CITY and PORT */ for (i = 0; i < B_LAST; i++) { - if (is_wonder(i) && could_build_improvement(pcity, i) && !wonder_obsolete(i)) { + if (is_wonder(i) && could_build_improvement(pcity, i) && !wonder_obsolete(i)&& is_wonder_usefull(i)) { if (i == B_ASMITHS) for (j = 0; j < B_LAST; j++) if (city_got_building(pcity, j) && improvement_upkeep(pcity, j) == 1) diff -ur -Xfreeciv/diff_ignore freeciv/common/city.c freeciv-mod/common/city.c --- freeciv/common/city.c Thu May 11 00:44:52 2000 +++ freeciv-mod/common/city.c Thu May 11 01:04:25 2000 @@ -310,6 +310,16 @@ } /************************************************************************** +Barbarians don't get enough knowledges to be counted as normal players. +**************************************************************************/ + +int is_wonder_usefull(Impr_Type_id id) +{ + if ((id == B_GREAT) && (get_nb_human_and_ai_players () < 3)) return 0; + return 1; +} + +/************************************************************************** ... **************************************************************************/ diff -ur -Xfreeciv/diff_ignore freeciv/common/city.h freeciv-mod/common/city.h --- freeciv/common/city.h Thu May 11 00:44:57 2000 +++ freeciv-mod/common/city.h Thu May 11 01:01:19 2000 @@ -256,6 +256,7 @@ int improvement_obsolete(struct player *pplayer, Impr_Type_id id); struct improvement_type *get_improvement_type(Impr_Type_id id); int wonder_obsolete(Impr_Type_id id); +int is_wonder_usefull(Impr_Type_id id); int is_wonder(Impr_Type_id id); int improvement_exists(Impr_Type_id id); Impr_Type_id find_improvement_by_name(char *s); diff -ur -Xfreeciv/diff_ignore freeciv/common/game.c freeciv-mod/common/game.c --- freeciv/common/game.c Thu May 11 19:42:40 2000 +++ freeciv-mod/common/game.c Thu May 11 19:58:15 2000 @@ -755,6 +755,7 @@ game.auto_ai_toggle = GAME_DEFAULT_AUTO_AI_TOGGLE; game.barbarianrate = GAME_DEFAULT_BARBARIANRATE; game.onsetbarbarian = GAME_DEFAULT_ONSETBARBARIAN; + game.nbarbarians = 0; game.occupychance= GAME_DEFAULT_OCCUPYCHANCE; game.heating = 0; sz_strlcpy(game.save_name, "civgame"); @@ -890,6 +891,8 @@ { struct player *pplayer=&game.players[plrno]; + if (is_barbarian(pplayer)) game.nbarbarians--; + unit_list_iterate(pplayer->units, punit) game_remove_unit(punit->id); unit_list_iterate_end; @@ -942,6 +945,14 @@ return &game.players[player_id]; } +/************************************************************************** +This function is used by is_wonder_usefull to estimate if it is worthwhile +to build the great library. +**************************************************************************/ +int get_nb_human_and_ai_players(void) +{ +return game.nplayers-game.nbarbarians; +} /*************************************************************** For various data, copy eg .name to .name_orig and put diff -ur -Xfreeciv/diff_ignore freeciv/common/game.h freeciv-mod/common/game.h --- freeciv/common/game.h Thu May 11 00:45:07 2000 +++ freeciv-mod/common/game.h Thu May 11 00:54:59 2000 @@ -57,6 +57,7 @@ int aifill; int barbarianrate; int onsetbarbarian; + int nbarbarians; int occupychance; int unhappysize; char *startmessage; @@ -161,6 +162,7 @@ void translate_data_names(void); struct player *get_player(int player_id); +int get_nb_human_and_ai_players (void); extern struct civ_game game; diff -ur -Xfreeciv/diff_ignore freeciv/server/barbarian.c freeciv-mod/server/barbarian.c --- freeciv/server/barbarian.c Thu May 11 00:45:12 2000 +++ freeciv-mod/server/barbarian.c Thu May 11 00:55:04 2000 @@ -165,6 +165,7 @@ init_tech(barbarians, game.tech); game.nplayers++; + game.nbarbarians++; game.max_players = game.nplayers; freelog(LOG_VERBOSE, "Created barbarian %s, player %d", barbarians->name, diff -ur -Xfreeciv/diff_ignore freeciv/server/gamehand.c freeciv-mod/server/gamehand.c --- freeciv/server/gamehand.c Wed May 10 21:26:24 2000 +++ freeciv-mod/server/gamehand.c Thu May 11 20:08:57 2000 @@ -374,6 +374,8 @@ "game.barbarians"); game.onsetbarbarian = secfile_lookup_int_default(file, game.onsetbarbarian, "game.onsetbarbs"); + game.nbarbarians = 0; /* counted in player_load for compatibility with + 1.10.0 */ game.occupychance = secfile_lookup_int_default(file, game.occupychance, "game.occupychance"); diff -ur -Xfreeciv/diff_ignore freeciv/server/plrhand.c freeciv-mod/server/plrhand.c --- freeciv/server/plrhand.c Wed May 10 21:26:24 2000 +++ freeciv-mod/server/plrhand.c Thu May 11 20:00:38 2000 @@ -1978,6 +1978,7 @@ plr->ai.is_barbarian = secfile_lookup_int_default(file, 0, "player%d.ai.is_barbarian", plrno); + if (is_barbarian(plr)) game.nbarbarians++; sz_strlcpy(plr->name, secfile_lookup_str(file, "player%d.name", plrno)); sz_strlcpy(plr->username,