Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: Tech cost patch v7

[Freeciv-Dev] Re: Tech cost patch v7

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Tech cost patch v7
From: Juha Litola <slave@xxxxxxxxxxxx>
Date: Fri, 30 Nov 2001 13:37:17 +0200

On Fri, Nov 30, 2001 at 12:13:36PM +0100, Raimar Falke wrote:

> num_req_techs() can be removed. The code should go into
Okay, I'll zap it.

> precalc_tech_data. IMHO
> +  if(counted[tech])
> +    return 0;
> should be
> +  if(counted[tech])
> +    return advances[tech].num_reqs

No, it would go wrong then. Imagine tech tree like below.

        tech a
    |            |
  tech b      tech c
       |      |
        tech d

Where tech a is requirement for tech b and so on.
Currently num_tech_reqs return 4 for tech d. If I'd implement your
change, it would give 5, as tech a will be counted twice. That will
leak to highly inconsistent costs in techs that have common requirements.

I'll send fixed patch in the evening, don't want to flood maillist
if I get more comments.

// Juha Litola

Attachment: pgpmpRBO89AgX.pgp
Description: PGP signature

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