diff -r -u patch_freeciv_orig/common/game.c patch_freeciv_new/common/game.c --- patch_freeciv_orig/common/game.c Wed Jun 27 13:38:05 2001 +++ patch_freeciv_new/common/game.c Fri Jul 27 13:51:36 2001 @@ -700,6 +700,7 @@ game.explorer = GAME_DEFAULT_EXPLORER; game.dispersion = GAME_DEFAULT_DISPERSION; game.cityfactor = GAME_DEFAULT_CITYFACTOR; + game.citymindist = GAME_DEFAULT_CITYMINDIST; game.civilwarsize= GAME_DEFAULT_CIVILWARSIZE; game.unhappysize = GAME_DEFAULT_UNHAPPYSIZE; game.foodbox = GAME_DEFAULT_FOODBOX; diff -r -u patch_freeciv_orig/common/game.h patch_freeciv_new/common/game.h --- patch_freeciv_orig/common/game.h Tue Jul 3 13:48:58 2001 +++ patch_freeciv_new/common/game.h Fri Jul 27 13:51:36 2001 @@ -13,12 +13,12 @@ #ifndef FC__GAME_H #define FC__GAME_H -#include /* time_t */ +#include /* time_t */ #ifdef HAVE_SYS_TIME_H #include #endif -#include "connection.h" /* struct conn_list */ +#include "connection.h" /* struct conn_list */ #include "shared.h" #include "player.h" @@ -50,7 +50,7 @@ #define CONTAMINATION_FALLOUT 2 struct civ_game { - int is_new_game; /* 1 for games never started */ + int is_new_game; /* 1 for games never started */ int version; int civstyle; int gold; @@ -70,6 +70,7 @@ int diplcost, freecost, conquercost; int diplchance; int cityfactor; + int citymindist; int civilwarsize; int min_players, max_players, nplayers; int aifill; @@ -79,7 +80,7 @@ int occupychance; int unhappysize; char *startmessage; - int conn_id; /* client-only: id client known to server as */ + int conn_id; /* client-only: id client known to server as */ int player_idx; struct player *player_ptr; struct player players[MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS]; @@ -89,17 +90,17 @@ int global_advances[A_LAST]; /* a counter */ int global_wonders[B_LAST]; /* contains city id's */ /* global_wonders[] may also be (-1), or the id of a city - which no longer exists, if the wonder has been destroyed */ + which no longer exists, if the wonder has been destroyed */ int heating; /* Number of polluted squares. */ int globalwarming; /* Total damage done. (counts towards a warming event.) */ int warminglevel; /* If globalwarming is higher than this number there is - a chance of a warming event. */ + a chance of a warming event. */ int cooling; /* Number of irradiated squares. */ int nuclearwinter; /* Total damage done. (counts towards a cooling event.) */ int coolinglevel; /* If nuclearwinter is higher than this number there is - a chance of a cooling event. */ + a chance of a cooling event. */ char save_name[MAX_LEN_NAME]; int save_nturns; @@ -119,8 +120,8 @@ int fixedlength; int auto_ai_toggle; int fogofwar; - int fogofwar_old; /* as the fog_of_war bit get changed by setting - the server we need to remember the old setting */ + int fogofwar_old; /* as the fog_of_war bit get changed by setting + the server we need to remember the old setting */ int num_unit_types; int num_impr_types; @@ -129,7 +130,7 @@ int government_count; int default_government; int government_when_anarchy; - int ai_goal_government; /* kludge */ + int ai_goal_government; /* kludge */ int nation_count; int playable_nation_count; @@ -145,17 +146,17 @@ char cities[MAX_LEN_NAME]; char game[MAX_LEN_NAME]; } ruleset; - int firepower_factor; /* See README.rulesets */ + int firepower_factor; /* See README.rulesets */ struct { - int get_bonus_tech; /* eg Philosophy */ - int cathedral_plus; /* eg Theology */ - int cathedral_minus; /* eg Communism */ - int colosseum_plus; /* eg Electricity */ - int temple_plus; /* eg Mysticism */ - int nav; /* AI convenience: tech_req for first - non-trireme ferryboat */ - int u_partisan; /* convenience: tech_req for first - Partisan unit */ + int get_bonus_tech; /* eg Philosophy */ + int cathedral_plus; /* eg Theology */ + int cathedral_minus; /* eg Communism */ + int colosseum_plus; /* eg Electricity */ + int temple_plus; /* eg Mysticism */ + int nav; /* AI convenience: tech_req for first + non-trireme ferryboat */ + int u_partisan; /* convenience: tech_req for first + Partisan unit */ /* Following tech list is A_LAST terminated if shorter than max len, and the techs listed are guaranteed to exist; this could be better implemented as a new field in the @@ -237,33 +238,33 @@ #define GAME_MIN_RANDSEED 0 #define GAME_MAX_RANDSEED (MAX_UINT32 >> 1) -#define GAME_DEFAULT_GOLD 50 -#define GAME_MIN_GOLD 0 -#define GAME_MAX_GOLD 5000 - -#define GAME_DEFAULT_SETTLERS 2 -#define GAME_MIN_SETTLERS 1 -#define GAME_MAX_SETTLERS 10 - -#define GAME_DEFAULT_EXPLORER 1 -#define GAME_MIN_EXPLORER 0 -#define GAME_MAX_EXPLORER 10 - -#define GAME_DEFAULT_DISPERSION 0 -#define GAME_MIN_DISPERSION 0 -#define GAME_MAX_DISPERSION 10 - -#define GAME_DEFAULT_TECHLEVEL 3 -#define GAME_MIN_TECHLEVEL 0 -#define GAME_MAX_TECHLEVEL 50 - -#define GAME_DEFAULT_UNHAPPYSIZE 4 -#define GAME_MIN_UNHAPPYSIZE 1 -#define GAME_MAX_UNHAPPYSIZE 6 - -#define GAME_DEFAULT_END_YEAR 2000 -#define GAME_MIN_END_YEAR GAME_START_YEAR -#define GAME_MAX_END_YEAR 5000 +#define GAME_DEFAULT_GOLD 50 +#define GAME_MIN_GOLD 0 +#define GAME_MAX_GOLD 5000 + +#define GAME_DEFAULT_SETTLERS 2 +#define GAME_MIN_SETTLERS 1 +#define GAME_MAX_SETTLERS 10 + +#define GAME_DEFAULT_EXPLORER 1 +#define GAME_MIN_EXPLORER 0 +#define GAME_MAX_EXPLORER 10 + +#define GAME_DEFAULT_DISPERSION 0 +#define GAME_MIN_DISPERSION 0 +#define GAME_MAX_DISPERSION 10 + +#define GAME_DEFAULT_TECHLEVEL 3 +#define GAME_MIN_TECHLEVEL 0 +#define GAME_MAX_TECHLEVEL 50 + +#define GAME_DEFAULT_UNHAPPYSIZE 4 +#define GAME_MIN_UNHAPPYSIZE 1 +#define GAME_MAX_UNHAPPYSIZE 6 + +#define GAME_DEFAULT_END_YEAR 2000 +#define GAME_MIN_END_YEAR GAME_START_YEAR +#define GAME_MAX_END_YEAR 5000 #define GAME_DEFAULT_MIN_PLAYERS 1 #define GAME_MIN_MIN_PLAYERS 1 @@ -277,8 +278,8 @@ #define GAME_MIN_AIFILL 0 #define GAME_MAX_AIFILL GAME_MAX_MAX_PLAYERS -#define GAME_DEFAULT_RESEARCHCOST 10 -#define GAME_MIN_RESEARCHCOST 4 +#define GAME_DEFAULT_RESEARCHCOST 10 +#define GAME_MIN_RESEARCHCOST 4 #define GAME_MAX_RESEARCHCOST 100 #define GAME_DEFAULT_DIPLCOST 0 @@ -301,6 +302,12 @@ #define GAME_MIN_CONQUERCOST 0 #define GAME_MAX_CONQUERCOST 100 +#define GAME_DEFAULT_CITYMINDIST 0 /* set this to 3 ... */ +#define GAME_MIN_CITYMINDIST 0 /* set this to 1 .. when the ruleset */ + /* when ruleset-to-servervariable */ + /* patch is made */ +#define GAME_MAX_CITYMINDIST 5 + #define GAME_DEFAULT_CITYFACTOR 14 #define GAME_MIN_CITYFACTOR 6 #define GAME_MAX_CITYFACTOR 100 @@ -366,7 +373,7 @@ #define GAME_MAX_BARBARIANRATE 4 #define GAME_DEFAULT_ONSETBARBARIAN (GAME_START_YEAR+ \ - ((GAME_DEFAULT_END_YEAR-(GAME_START_YEAR))/3)) + ((GAME_DEFAULT_END_YEAR-(GAME_START_YEAR))/3)) #define GAME_MIN_ONSETBARBARIAN GAME_START_YEAR #define GAME_MAX_ONSETBARBARIAN GAME_MAX_END_YEAR Only in patch_freeciv_new/server: game.h diff -r -u patch_freeciv_orig/server/ruleset.c patch_freeciv_new/server/ruleset.c --- patch_freeciv_orig/server/ruleset.c Sun Jul 22 13:53:54 2001 +++ patch_freeciv_new/server/ruleset.c Fri Jul 27 13:51:50 2001 @@ -2111,8 +2111,14 @@ game.rgame.min_city_center_trade = secfile_lookup_int(&file, "civstyle.min_city_center_trade"); - game.rgame.min_dist_bw_cities = - secfile_lookup_int(&file, "civstyle.min_dist_bw_cities"); + if (game.citymindist==0) { + /* solution until the rulesets-to-server-variables change is made */ + game.rgame.min_dist_bw_cities = + secfile_lookup_int(&file, "civstyle.min_dist_bw_cities"); + } else { + game.rgame.min_dist_bw_cities = game.citymindist; + } + if(game.rgame.min_dist_bw_cities<1) { freelog(LOG_ERROR, "Bad value %i for min_dist_bw_cities. Using 2.", game.rgame.min_dist_bw_cities); diff -r -u patch_freeciv_orig/server/savegame.c patch_freeciv_new/server/savegame.c --- patch_freeciv_orig/server/savegame.c Thu May 24 13:35:39 2001 +++ patch_freeciv_new/server/savegame.c Fri Jul 27 13:51:50 2001 @@ -1859,6 +1859,8 @@ game.civstyle = secfile_lookup_int_default(file, 0, "game.civstyle"); game.save_nturns = secfile_lookup_int(file, "game.save_nturns"); } + + game.citymindist = secfile_lookup_int_default(file, -1, "game.citymindist"); sz_strlcpy(game.save_name, secfile_lookup_str_default(file, GAME_DEFAULT_SAVE_NAME, @@ -2180,6 +2182,7 @@ secfile_insert_int(file, game.coolinglevel, "game.coolinglevel"); secfile_insert_int(file, game.unhappysize, "game.unhappysize"); secfile_insert_int(file, game.cityfactor, "game.cityfactor"); + secfile_insert_int(file, game.citymindist, "game.citymindist"); secfile_insert_int(file, game.civilwarsize, "game.civilwarsize"); secfile_insert_int(file, game.diplcost, "game.diplcost"); secfile_insert_int(file, game.freecost, "game.freecost"); diff -r -u patch_freeciv_orig/server/stdinhand.c patch_freeciv_new/server/stdinhand.c --- patch_freeciv_orig/server/stdinhand.c Mon Jul 9 13:43:41 2001 +++ patch_freeciv_new/server/stdinhand.c Fri Jul 27 13:51:50 2001 @@ -468,6 +468,16 @@ "Democracy; for other governments the effect occurs at " "smaller numbers of cities.") }, + { "citymindist", &game.citymindist, NULL, NULL, + SSET_RULES, SSET_TO_CLIENT, + GAME_MIN_CITYMINDIST, GAME_MAX_CITYMINDIST, GAME_DEFAULT_CITYMINDIST, + N_("Minimum distance between cities (move distance)"), + N_("When a player founds a new city, it is checked if there is no " + "other city in citymindist distance. For example, if citymindist " + "is 3, there have to be at least two empty fields between two cities " + "every direction. If it is set to 0 (default), it is overwritten by " + "the current ruleset when the game starts.") }, + { "razechance", &game.razechance, NULL, NULL, SSET_RULES, SSET_TO_CLIENT, GAME_MIN_RAZECHANCE, GAME_MAX_RAZECHANCE, GAME_DEFAULT_RAZECHANCE,