Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13360) Choose random tech and future tech
Home

[Freeciv-Dev] (PR#13360) Choose random tech and future tech

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13360) Choose random tech and future tech
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 28 Jun 2005 03:18:37 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13360 >

> [mstefek - Tue Jun 28 10:15:21 2005]:
> 
> choose_random_tech can't set A_FUTURE and this leads to many bugs.
> For example: http://pubserver.freeciv.org/games/443089
> 
> Patch attached.
> --
> mateusz
> 
S2_0 version
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.330.2.27
diff -u -r1.330.2.27 plrhand.c
--- server/plrhand.c    27 Jun 2005 19:31:54 -0000      1.330.2.27
+++ server/plrhand.c    28 Jun 2005 10:17:28 -0000
@@ -615,11 +615,15 @@
 **************************************************************************/
 void choose_tech(struct player *plr, int tech)
 {
-  if (plr->research.researching==tech)
+  if (plr->research.researching == tech) {
     return;
-  if (get_invention(plr, tech)!=TECH_REACHABLE) { /* can't research this */
+  }
+
+  if (tech != A_FUTURE && get_invention(plr, tech) != TECH_REACHABLE) { 
+    /* can't research this */
     return;
   }
+  
   if (!plr->got_tech && plr->research.changed_from == -1) {
     plr->research.bulbs_researched_before = plr->research.bulbs_researched;
     plr->research.changed_from = plr->research.researching;

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