diff -Nur -X/home/thue/freeciv-dev/freeciv/diff_ignore freeciv/server/civserver.c workdir/server/civserver.c --- freeciv/server/civserver.c Sun May 14 17:07:54 2000 +++ workdir/server/civserver.c Sun May 14 21:42:33 2000 @@ -1706,6 +1706,13 @@ game.playable_nation_count); } + if (game.max_players < game.aifill) { + game.aifill = game.max_players; + freelog( LOG_NORMAL, + _("Maxplayers smaller than aifill; aifill reduced to %d."), + game.max_players); + } + for(;game.nplayers < game.aifill;) { nation = mark_nation_as_used(nations_avail[myrand(num_nations_avail)]); pick_ai_player_name(nation,player_name); diff -Nur -X/home/thue/freeciv-dev/freeciv/diff_ignore freeciv/server/gamehand.c workdir/server/gamehand.c --- freeciv/server/gamehand.c Sun May 14 17:07:54 2000 +++ workdir/server/gamehand.c Sun May 14 20:42:36 2000 @@ -68,18 +68,16 @@ map.start_positions[i].x=x; map.start_positions[i].y=y; } - } + for(i=0; i map.num_start_positions) { + freelog(LOG_VERBOSE, _("Reduced maxplayers from %i to %i to fit" + "to the number of start positions."), + game.max_players, map.num_start_positions); + game.max_players = map.num_start_positions; + } + + if (game.nplayers > game.max_players) { + /* Because of the way player ids are renumbered during + server_remove_player() this is correct */ + while (game.nplayers > game.max_players) + server_remove_player(get_player(game.max_players)); + + freelog(LOG_VERBOSE, _("Had to cut down the number of players to the " + "number of map start positions, there must be " + "something wrong with the savegame or you " + "adjusted the maxplayers value.")); + } + for (i=0;i