Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Tech cost patch v15 (PR#1082)
Home

[Freeciv-Dev] Tech cost patch v15 (PR#1082)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Tech cost patch v15 (PR#1082)
From: Juha Litola <slave@xxxxxxxxxxxx>
Date: Sun, 9 Dec 2001 13:40:42 +0200

On Sun, Dec 09, 2001 at 01:19:04PM +0200, Juha Litola wrote:
> On Sat, Dec 08, 2001 at 07:12:51PM +0100, Reinier Post wrote:
> 
> > +  if(req[tech]++ || get_invention(pplayer, tech) == TECH_KNOWN)
> > +    return 0;
> Mark this technology as requirement in requirement array. If this
> was marked as requirement before in recursive search, assign no
> extra requirement. Also if technology is already known, it shouldn't
> be added as requirement.
This line indeed had a bug. Increment should happen later so it should
read:
+  if(req[tech] || get_invention(pplayer, tech) == TECH_KNOWN)
+    return 0;
+
+  req[tech]++;

I misread the code in aitech.c find_prerequisites, this is how
it does checking. This bug had no effect on gameplay, but this 
is correct way.

v15 included.
-- 
// Juha Litola

Attachment: tech_cost_style15.diff.gz
Description: Binary data

Attachment: pgpT2naw84yzJ.pgp
Description: PGP signature


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