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

Patches attached for S2_0 and S2_1:
They just fix the problem.

I will make an other patch for S2_2 and trunk, replacing the (struct
player *) reference by (struct player_research *) when it is linked with
the technology code.

Index: server/srv_main.c
===================================================================
--- server/srv_main.c	(révision 13781)
+++ server/srv_main.c	(copie de travail)
@@ -1860,8 +1860,6 @@
       int i;
       bool free_techs_already_given = FALSE;
 
-      give_initial_techs(pplayer);
-    
       players_iterate(eplayer) {
         if (players_on_same_team(eplayer, pplayer) &&
             eplayer->player_no < pplayer->player_no) {
@@ -1873,7 +1871,11 @@
       if (free_techs_already_given) {
         break;
       }
-      for (i = 0; i < game.tech; i++) {
+
+      give_initial_techs(pplayer);
+      /* Note that A_NONE is always marked as researched, so the real number
+       * of techs_researched is (techs_researched - 1). */
+      for (i = pplayer->research.techs_researched - 1; i < game.tech; i++) {
         give_random_initial_tech(pplayer);
       }
     } players_iterate_end;
Index: server/srv_main.c
===================================================================
--- server/srv_main.c	(révision 13773)
+++ server/srv_main.c	(copie de travail)
@@ -2010,10 +2010,6 @@
     } players_iterate_end;
 
     players_iterate(pplayer) {
-      give_initial_techs(pplayer);
-    } players_iterate_end;
-    
-    players_iterate(pplayer) {
       int i;
       bool free_techs_already_given = FALSE;
       
@@ -2028,8 +2024,12 @@
       if (free_techs_already_given) {
         break;
       }
-      
-      for (i = 0; i < game.info.tech; i++) {
+
+      give_initial_techs(pplayer);
+      /* Note that A_NONE is always marked as researched, so the real number
+       * of techs_researched is (techs_researched - 1). */
+      for (i = get_player_research(pplayer)->techs_researched - 1;
+           i < game.info.tech; i++) {
         give_random_initial_tech(pplayer);
       }
     } players_iterate_end;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to