Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2001:
[Freeciv-Dev] Re: researchspeed patch
Home

[Freeciv-Dev] Re: researchspeed patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: researchspeed patch
From: David Pfitzner <dwpfitzner@xxxxxxxxx>
Date: Sun, 25 Mar 2001 18:59:36 -0800 (PST)

Arien Malec <arien_malec@xxxxxxxxx> wrote: 

> --- David Pfitzner <dwpfitzner@xxxxxxxxx> wrote:

> > > The only tricky bit is ensuring that save files with techlevel can
> > be
> > > loaded in. I put a check on game.version to selectively load in
> > from
> > > game.researchspeed or game.techlevel. I haven't really tested that,
> > > however.
> > 
> > This isn't a good way to do it.  Some old code does this, but it 
> > is deprecated -- see comments up just a bit in game_load().  Instead,
> > 
> > call section_file_lookup() to see if game.researchspeed is in the
> > file, 
> > and if not then fall back to looking up game.techlevel.
> 
> The problem is that, after changing "techlevel" to "researchspeed" (or
> whatever), I might then want to change game.tech to game.techlevel
> (although game.tech is understandable on the analogy of game.gold...),
> and then I'm in trouble.

But then at least it will be your future self doing something wrong,
not your current self :-)

> Checking on version is more generalizable, I
> would think, and documents what happend better (prior to version x.y.z,
> game.researchspeed was game.techlevel).

The problem with using the version number is that it breaks 
savegames for people using the CVS "version".  Thats bad.  
Another alternative (also mentioned in the comment in the code 
mentioned above) is to use savefile_options, but I don't 
personally like that much if its avoidable, and it normally
is, by introducing other variables into the savegame.

-- David

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



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