Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] Re: (PR#6987) corrupt technology
Home

[Freeciv-Dev] Re: (PR#6987) corrupt technology

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ggracian@xxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6987) corrupt technology
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 13 Feb 2004 13:59:38 -0800
Reply-to: rt@xxxxxxxxxxx

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

> Genevieve Gracian wrote:
>>I noticed something new. With a default compress and techlevel 5 when I
>>save manually in 3950 BC and reload the game I gain 2 techs freely.

This was caused by this patch:

date: 2003/06/26 23:03:13;  author: jdorje;  state: Exp;  lines: +6 -2
Allow technologies to be restricted by nation.  A tech that is given a 
root_req can only be acquired (researched, stolen, etc.) by a nation 
that already knows that "root" technology.  Thus nations may be 
completely denied access to some technologies.
 

Patch by Per Mathisen as PR#2464, with style fixes and updated capstring 
by me.

And the attached patch fixes it.

This probably accounts for all of the "researching a known tech" 
problems we've been seeing.  If only we'd realized sooner that it 
related to techlevel.

Just another example of how bugs can hide in options that aren't often 
used...

jason

? server/output
Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.145
diff -u -r1.145 savegame.c
--- server/savegame.c   2004/01/20 21:52:09     1.145
+++ server/savegame.c   2004/02/13 21:55:29
@@ -634,7 +634,9 @@
     p = (char *)name_order[secfile_lookup_int(file, "player%d.race", plrno)];
   }
   plr->nation = find_nation_by_name_orig(p);
-  init_tech(plr, game.tech); /* add techs from game and nation here */
+
+  /* Add techs from game and nation, but ignore game.techlevel. */
+  init_tech(plr, 0);
 
   /* not all players have teams */
   if (section_file_lookup(file, "player%d.team", plrno)) {

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