Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2790) [Fwd: Re: [FreeCiv-Cvs] rfalke: Remove useless t
Home

[Freeciv-Dev] (PR#2790) [Fwd: Re: [FreeCiv-Cvs] rfalke: Remove useless t

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2790) [Fwd: Re: [FreeCiv-Cvs] rfalke: Remove useless tests for A_NONE since get_in...]
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Thu, 9 Jan 2003 23:05:26 -0800
Reply-to: rt@xxxxxxxxxxxxxx

See PR#2715.

-------- Original Message --------
Subject: [Freeciv-Dev] Re: [FreeCiv-Cvs] rfalke: Remove useless tests 
for     A_NONE since get_in...
Date: Thu, 9 Jan 2003 18:54:01 +0100
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
To: freeciv-dev@xxxxxxxxxxx
References: <200301091611.h09GB0gt015592@xxxxxxxxxxxxxxxxxxx>

On Thu, Jan 09, 2003 at 08:11:00AM -0800, freeciv@xxxxxxxxxxxxxxxxxxx wrote:
> This is an automated notification of a change to freeciv cvs, 
> on Thu Jan  9 08:03:44 PST 2003 = Thu Jan  9 16:03:44 2003 (GMT)
> by Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
> 
> ---- Files affected:
> 
> freeciv/common government.c tech.c
> 
> ---- Log message:
>       Tag: HEAD
> 
> Remove useless tests for A_NONE since get_invention(x, A_NONE) is
> always TECH_KNOWN.

Sadly this isn't always true. At the client the A_NONE of an enemy
isn't TECH_KNOWN but TECH_UNKNOWN. The attached patch fixes this.

        Raimar

-- 
  email: rf13@xxxxxxxxxxxxxxxxx
  "At the beginning of the week, we sealed ten BSD programmers
   into a computer room with a single distribution of BSD Unix.
   Upon opening the room after seven days, we found all ten programmers
   dead, clutching each other's throats, and thirteen new flavors of BSD."


Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.254
diff -u -u -r1.254 plrhand.c
--- server/plrhand.c    2003/01/05 23:24:52     1.254
+++ server/plrhand.c    2003/01/09 17:45:47
@@ -1156,15 +1156,18 @@
 
   if (info_level >= INFO_MEETING) {
     packet->gold            = plr->economic.gold;
-    for (i = 0; i < game.num_tech_types; i++) {
+    for (i = A_NONE; i < game.num_tech_types; i++) {
       packet->inventions[i] = plr->research.inventions[i].state + '0';
     }
     packet->inventions[i]   = '\0';
     packet->government      = plr->government;
   } else {
     packet->gold            = 0;
-    for(i=0; i<game.num_tech_types; i++)
+    for (i = A_NONE; i < game.num_tech_types; i++) {
       packet->inventions[i] = '0';
+    }
+    packet->inventions[A_NONE] =
+       plr->research.inventions[A_NONE].state + '0';
     packet->inventions[i]   = '\0';
 
     /* Ideally, we should check whether receiver really sees any cities owned


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2790) [Fwd: Re: [FreeCiv-Cvs] rfalke: Remove useless tests for A_NONE since get_in...], Jason Short via RT <=