Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#10051) max_players change on load
Home

[Freeciv-Dev] (PR#10051) max_players change on load

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: marko.lindqvist@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10051) max_players change on load
From: "Brett Albertson" <brett.albertson@xxxxxxxxxxxx>
Date: Sun, 12 Sep 2004 18:28:35 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10051 >

> [marko.lindqvist@xxxxxxxxxxx - Sat Sep 11 17:11:42 2004]:
> 
> ./ser -f civgame+1400.sav.gz
> save test1
> quit
> 
> gzip -d civgame+1400.sav.gz
> gzip -d test1.gz
> diff -Nurd civgame+1400.sav test1
> 
> --- civgame+1400.sav    2004-09-11 19:30:35.000000000 +0300
> +++ test1       2004-09-11 19:30:21.000000000 +0300
> @@ -18,7 +18,7 @@
>   turn=190
>   researchcost=10
>   min_players=1
> -max_players=8
> +max_players=6
>   nplayers=8

I think the problem is in line 1796 of srv_main.c.  It sets the 
max_players to the number of players it finds upon iterating through 
the players.  It overwrites the max_players it gets from the saved 
game.  I assume this should check if the game was loaded and only set 
max_players if it was not loaded.

instead of:

    game.max_players = game.nplayers;

something like:

    if (game.is_new_game) {
        game.max_players = game.nplayers;
    }

comments?

-- 
Brett Albertson
brett.albertson@xxxxxxxxxxxx


[Prev in Thread] Current Thread [Next in Thread]