Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8871) put specialist configuration info into an ar
Home

[Freeciv-Dev] Re: (PR#8871) put specialist configuration info into an ar

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8871) put specialist configuration info into an array
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 29 May 2004 21:27:03 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8871 >

Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8871 >
> 
> This patch puts the specialists configuration data (min_size and bonus 
> info) into an array.  This is done in game.h and packets.def.
> 
> Most users are just search-and-replace changed into the new interface. 
> A few users are simplified.

Fixed one bug: T_COUNT was used instead of SP_COUNT.

jason

? diff
? ferries
? flags
? data/flags
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.373
diff -u -r1.373 packhand.c
--- client/packhand.c   29 May 2004 20:57:16 -0000      1.373
+++ client/packhand.c   30 May 2004 04:24:13 -0000
@@ -2675,12 +2675,10 @@
 {
   int i;
 
-  game.rgame.min_size_elvis = packet->min_size_elvis;
-  game.rgame.min_size_taxman = packet->min_size_taxman;
-  game.rgame.min_size_scientist = packet->min_size_scientist;
-  game.rgame.base_elvis = packet->base_elvis;
-  game.rgame.base_scientist = packet->base_scientist;
-  game.rgame.base_taxman = packet->base_taxman;
+  for (i = 0; i < T_COUNT; i++) {
+    game.rgame.specialists[i].min_size = packet->specialist_min_size[i];
+    game.rgame.specialists[i].bonus = packet->specialist_bonus[i];
+  }
   game.rgame.changable_tax = packet->changable_tax;
   game.rgame.forced_science = packet->forced_science;
   game.rgame.forced_luxury = packet->forced_luxury;
Index: common/capstr.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v
retrieving revision 1.166
diff -u -r1.166 capstr.c
--- common/capstr.c     21 May 2004 19:03:43 -0000      1.166
+++ common/capstr.c     30 May 2004 04:24:13 -0000
@@ -77,7 +77,7 @@
 #define CAPABILITY "+1.14.delta +last_turns_shield_surplus veteran +orders " \
                    "+starter +union +iso_maps +orders2client " \
                    "+change_production +tilespec1 +no_earth +trans " \
-                   "+want_hack invasions bombard +killstack2 spec"
+                   "+want_hack invasions bombard +killstack2 spec +spec2"
 
 /* "+1.14.delta" is the new delta protocol for 1.14.0-dev.
  *
@@ -117,6 +117,8 @@
  * "bombard" means units support the bombard ability.
  * 
  * "spec" is configurable specialists
+ *
+ * "spec2" is semi-configurable specialists in an array
  */
 
 void init_our_capability(void)
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.213
diff -u -r1.213 city.c
--- common/city.c       29 May 2004 20:57:16 -0000      1.213
+++ common/city.c       30 May 2004 04:24:14 -0000
@@ -1821,13 +1821,13 @@
   pcity->tax_total = tax;
   pcity->luxury_total = lux;
 
-  pcity->luxury_total
-    += (pcity->specialists[SP_ELVIS] * game.rgame.base_elvis);
-  pcity->science_total
-    += (pcity->specialists[SP_SCIENTIST] * game.rgame.base_scientist);
-  pcity->tax_total
-    += ((pcity->specialists[SP_TAXMAN] * game.rgame.base_taxman) 
-       + get_city_tithes_bonus(pcity));
+  pcity->luxury_total += (pcity->specialists[SP_ELVIS]
+                         * game.rgame.specialists[SP_ELVIS].bonus);
+  pcity->science_total += (pcity->specialists[SP_SCIENTIST]
+                          * game.rgame.specialists[SP_SCIENTIST].bonus);
+  pcity->tax_total += ((pcity->specialists[SP_TAXMAN]
+                       * game.rgame.specialists[SP_TAXMAN].bonus) 
+                      + get_city_tithes_bonus(pcity));
 }
 
 /**************************************************************************
Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.140
diff -u -r1.140 game.h
--- common/game.h       25 May 2004 00:40:20 -0000      1.140
+++ common/game.h       30 May 2004 04:24:14 -0000
@@ -186,12 +186,9 @@
 
   /* values from game.ruleset */
   struct {
-    int min_size_elvis;
-    int min_size_taxman;
-    int min_size_scientist;
-    int base_elvis;
-    int base_scientist;
-    int base_taxman;
+    struct {
+      int min_size, bonus;
+    } specialists[SP_COUNT];
     bool changable_tax;
     int forced_science; /* only relevant if !changable_tax */
     int forced_luxury;
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.24
diff -u -r1.24 packets.def
--- common/packets.def  27 May 2004 22:14:18 -0000      1.24
+++ common/packets.def  30 May 2004 04:24:14 -0000
@@ -956,12 +956,8 @@
 end
 
 PACKET_RULESET_GAME=97;sc,lsend
-  UINT8 min_size_elvis; add-cap(spec)
-  UINT8 min_size_taxman; add-cap(spec)
-  UINT8 min_size_scientist; add-cap(spec)
-  UINT8 base_elvis; add-cap(spec)
-  UINT8 base_scientist; add-cap(spec)
-  UINT8 base_taxman; add-cap(spec)
+  UINT8 specialist_min_size[T_COUNT];
+  UINT8 specialist_bonus[T_COUNT];
   BOOL changable_tax; add-cap(spec)
   UINT8 forced_science; add-cap(spec)
   UINT8 forced_luxury; add-cap(spec)
Index: common/packets_gen.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets_gen.c,v
retrieving revision 1.28
diff -u -r1.28 packets_gen.c
--- common/packets_gen.c        27 May 2004 22:14:18 -0000      1.28
+++ common/packets_gen.c        30 May 2004 04:24:15 -0000
@@ -21672,7 +21672,7 @@
 
 #define cmp_packet_ruleset_game_100 cmp_const
 
-BV_DEFINE(packet_ruleset_game_100_fields, 28);
+BV_DEFINE(packet_ruleset_game_100_fields, 24);
 
 static struct packet_ruleset_game *receive_packet_ruleset_game_100(struct 
connection *pc, enum packet_type type)
 {
@@ -21697,56 +21697,58 @@
   }
 
   if (BV_ISSET(fields, 0)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_size_elvis);
+    
+    {
+      int i;
+    
+      for (i = 0; i < T_COUNT; i++) {
+        dio_get_uint8(&din, (int *) &real_packet->specialist_min_size[i]);
+      }
+    }
   }
   if (BV_ISSET(fields, 1)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_size_taxman);
-  }
-  if (BV_ISSET(fields, 2)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_size_scientist);
+    
+    {
+      int i;
+    
+      for (i = 0; i < T_COUNT; i++) {
+        dio_get_uint8(&din, (int *) &real_packet->specialist_bonus[i]);
+      }
+    }
   }
+  real_packet->changable_tax = BV_ISSET(fields, 2);
   if (BV_ISSET(fields, 3)) {
-    dio_get_uint8(&din, (int *) &real_packet->base_elvis);
-  }
-  if (BV_ISSET(fields, 4)) {
-    dio_get_uint8(&din, (int *) &real_packet->base_scientist);
-  }
-  if (BV_ISSET(fields, 5)) {
-    dio_get_uint8(&din, (int *) &real_packet->base_taxman);
-  }
-  real_packet->changable_tax = BV_ISSET(fields, 6);
-  if (BV_ISSET(fields, 7)) {
     dio_get_uint8(&din, (int *) &real_packet->forced_science);
   }
-  if (BV_ISSET(fields, 8)) {
+  if (BV_ISSET(fields, 4)) {
     dio_get_uint8(&din, (int *) &real_packet->forced_luxury);
   }
-  if (BV_ISSET(fields, 9)) {
+  if (BV_ISSET(fields, 5)) {
     dio_get_uint8(&din, (int *) &real_packet->forced_gold);
   }
-  if (BV_ISSET(fields, 10)) {
+  if (BV_ISSET(fields, 6)) {
     dio_get_uint8(&din, (int *) &real_packet->min_city_center_food);
   }
-  if (BV_ISSET(fields, 11)) {
+  if (BV_ISSET(fields, 7)) {
     dio_get_uint8(&din, (int *) &real_packet->min_city_center_shield);
   }
-  if (BV_ISSET(fields, 12)) {
+  if (BV_ISSET(fields, 8)) {
     dio_get_uint8(&din, (int *) &real_packet->min_city_center_trade);
   }
-  if (BV_ISSET(fields, 13)) {
+  if (BV_ISSET(fields, 9)) {
     dio_get_uint8(&din, (int *) &real_packet->min_dist_bw_cities);
   }
-  if (BV_ISSET(fields, 14)) {
+  if (BV_ISSET(fields, 10)) {
     dio_get_uint8(&din, (int *) &real_packet->init_vis_radius_sq);
   }
-  if (BV_ISSET(fields, 15)) {
+  if (BV_ISSET(fields, 11)) {
     dio_get_uint8(&din, (int *) &real_packet->hut_overflight);
   }
-  real_packet->pillage_select = BV_ISSET(fields, 16);
-  if (BV_ISSET(fields, 17)) {
+  real_packet->pillage_select = BV_ISSET(fields, 12);
+  if (BV_ISSET(fields, 13)) {
     dio_get_uint8(&din, (int *) &real_packet->nuke_contamination);
   }
-  if (BV_ISSET(fields, 18)) {
+  if (BV_ISSET(fields, 14)) {
     
     {
       int i;
@@ -21756,23 +21758,23 @@
       }
     }
   }
-  if (BV_ISSET(fields, 19)) {
+  if (BV_ISSET(fields, 15)) {
     dio_get_uint8(&din, (int *) &real_packet->granary_num_inis);
   }
-  if (BV_ISSET(fields, 20)) {
+  if (BV_ISSET(fields, 16)) {
     dio_get_uint8(&din, (int *) &real_packet->granary_food_inc);
   }
-  if (BV_ISSET(fields, 21)) {
+  if (BV_ISSET(fields, 17)) {
     dio_get_uint8(&din, (int *) &real_packet->tech_cost_style);
   }
-  if (BV_ISSET(fields, 22)) {
+  if (BV_ISSET(fields, 18)) {
     dio_get_uint8(&din, (int *) &real_packet->tech_leakage);
   }
-  if (BV_ISSET(fields, 23)) {
+  if (BV_ISSET(fields, 19)) {
     dio_get_tech_list(&din, real_packet->global_init_techs);
   }
-  real_packet->killstack = BV_ISSET(fields, 24);
-  if (BV_ISSET(fields, 25)) {
+  real_packet->killstack = BV_ISSET(fields, 20);
+  if (BV_ISSET(fields, 21)) {
     
     {
       int i;
@@ -21782,7 +21784,7 @@
       }
     }
   }
-  if (BV_ISSET(fields, 26)) {
+  if (BV_ISSET(fields, 22)) {
     
     {
       int i;
@@ -21792,7 +21794,7 @@
       }
     }
   }
-  if (BV_ISSET(fields, 27)) {
+  if (BV_ISSET(fields, 23)) {
     
     {
       int i;
@@ -21836,77 +21838,85 @@
     force_send_of_unchanged = TRUE;
   }
 
-  differ = (old->min_size_elvis != real_packet->min_size_elvis);
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 0);}
-
-  differ = (old->min_size_taxman != real_packet->min_size_taxman);
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 1);}
-
-  differ = (old->min_size_scientist != real_packet->min_size_scientist);
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 2);}
 
-  differ = (old->base_elvis != real_packet->base_elvis);
+    {
+      differ = (T_COUNT != T_COUNT);
+      if(!differ) {
+        int i;
+        for (i = 0; i < T_COUNT; i++) {
+          if (old->specialist_min_size[i] != 
real_packet->specialist_min_size[i]) {
+            differ = TRUE;
+            break;
+          }
+        }
+      }
+    }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 3);}
+  if(differ) {BV_SET(fields, 0);}
 
-  differ = (old->base_scientist != real_packet->base_scientist);
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 4);}
 
-  differ = (old->base_taxman != real_packet->base_taxman);
+    {
+      differ = (T_COUNT != T_COUNT);
+      if(!differ) {
+        int i;
+        for (i = 0; i < T_COUNT; i++) {
+          if (old->specialist_bonus[i] != real_packet->specialist_bonus[i]) {
+            differ = TRUE;
+            break;
+          }
+        }
+      }
+    }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 5);}
+  if(differ) {BV_SET(fields, 1);}
 
   differ = (old->changable_tax != real_packet->changable_tax);
   if(differ) {different++;}
-  if(packet->changable_tax) {BV_SET(fields, 6);}
+  if(packet->changable_tax) {BV_SET(fields, 2);}
 
   differ = (old->forced_science != real_packet->forced_science);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 7);}
+  if(differ) {BV_SET(fields, 3);}
 
   differ = (old->forced_luxury != real_packet->forced_luxury);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 8);}
+  if(differ) {BV_SET(fields, 4);}
 
   differ = (old->forced_gold != real_packet->forced_gold);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 9);}
+  if(differ) {BV_SET(fields, 5);}
 
   differ = (old->min_city_center_food != real_packet->min_city_center_food);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 10);}
+  if(differ) {BV_SET(fields, 6);}
 
   differ = (old->min_city_center_shield != 
real_packet->min_city_center_shield);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 11);}
+  if(differ) {BV_SET(fields, 7);}
 
   differ = (old->min_city_center_trade != real_packet->min_city_center_trade);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 12);}
+  if(differ) {BV_SET(fields, 8);}
 
   differ = (old->min_dist_bw_cities != real_packet->min_dist_bw_cities);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 13);}
+  if(differ) {BV_SET(fields, 9);}
 
   differ = (old->init_vis_radius_sq != real_packet->init_vis_radius_sq);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 14);}
+  if(differ) {BV_SET(fields, 10);}
 
   differ = (old->hut_overflight != real_packet->hut_overflight);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 15);}
+  if(differ) {BV_SET(fields, 11);}
 
   differ = (old->pillage_select != real_packet->pillage_select);
   if(differ) {different++;}
-  if(packet->pillage_select) {BV_SET(fields, 16);}
+  if(packet->pillage_select) {BV_SET(fields, 12);}
 
   differ = (old->nuke_contamination != real_packet->nuke_contamination);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 17);}
+  if(differ) {BV_SET(fields, 13);}
 
 
     {
@@ -21922,23 +21932,23 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 18);}
+  if(differ) {BV_SET(fields, 14);}
 
   differ = (old->granary_num_inis != real_packet->granary_num_inis);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 19);}
+  if(differ) {BV_SET(fields, 15);}
 
   differ = (old->granary_food_inc != real_packet->granary_food_inc);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 20);}
+  if(differ) {BV_SET(fields, 16);}
 
   differ = (old->tech_cost_style != real_packet->tech_cost_style);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 21);}
+  if(differ) {BV_SET(fields, 17);}
 
   differ = (old->tech_leakage != real_packet->tech_leakage);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 22);}
+  if(differ) {BV_SET(fields, 18);}
 
 
     {
@@ -21954,11 +21964,11 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 23);}
+  if(differ) {BV_SET(fields, 19);}
 
   differ = (old->killstack != real_packet->killstack);
   if(differ) {different++;}
-  if(packet->killstack) {BV_SET(fields, 24);}
+  if(packet->killstack) {BV_SET(fields, 20);}
 
 
     {
@@ -21974,7 +21984,7 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 25);}
+  if(differ) {BV_SET(fields, 21);}
 
 
     {
@@ -21990,7 +22000,7 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 26);}
+  if(differ) {BV_SET(fields, 22);}
 
 
     {
@@ -22006,7 +22016,7 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 27);}
+  if(differ) {BV_SET(fields, 23);}
 
   if (different == 0 && !force_send_of_unchanged) {
     return 0;
@@ -22015,56 +22025,58 @@
   DIO_BV_PUT(&dout, fields);
 
   if (BV_ISSET(fields, 0)) {
-    dio_put_uint8(&dout, real_packet->min_size_elvis);
+  
+    {
+      int i;
+
+      for (i = 0; i < T_COUNT; i++) {
+        dio_put_uint8(&dout, real_packet->specialist_min_size[i]);
+      }
+    } 
   }
   if (BV_ISSET(fields, 1)) {
-    dio_put_uint8(&dout, real_packet->min_size_taxman);
-  }
-  if (BV_ISSET(fields, 2)) {
-    dio_put_uint8(&dout, real_packet->min_size_scientist);
+  
+    {
+      int i;
+
+      for (i = 0; i < T_COUNT; i++) {
+        dio_put_uint8(&dout, real_packet->specialist_bonus[i]);
+      }
+    } 
   }
+  /* field 2 is folded into the header */
   if (BV_ISSET(fields, 3)) {
-    dio_put_uint8(&dout, real_packet->base_elvis);
-  }
-  if (BV_ISSET(fields, 4)) {
-    dio_put_uint8(&dout, real_packet->base_scientist);
-  }
-  if (BV_ISSET(fields, 5)) {
-    dio_put_uint8(&dout, real_packet->base_taxman);
-  }
-  /* field 6 is folded into the header */
-  if (BV_ISSET(fields, 7)) {
     dio_put_uint8(&dout, real_packet->forced_science);
   }
-  if (BV_ISSET(fields, 8)) {
+  if (BV_ISSET(fields, 4)) {
     dio_put_uint8(&dout, real_packet->forced_luxury);
   }
-  if (BV_ISSET(fields, 9)) {
+  if (BV_ISSET(fields, 5)) {
     dio_put_uint8(&dout, real_packet->forced_gold);
   }
-  if (BV_ISSET(fields, 10)) {
+  if (BV_ISSET(fields, 6)) {
     dio_put_uint8(&dout, real_packet->min_city_center_food);
   }
-  if (BV_ISSET(fields, 11)) {
+  if (BV_ISSET(fields, 7)) {
     dio_put_uint8(&dout, real_packet->min_city_center_shield);
   }
-  if (BV_ISSET(fields, 12)) {
+  if (BV_ISSET(fields, 8)) {
     dio_put_uint8(&dout, real_packet->min_city_center_trade);
   }
-  if (BV_ISSET(fields, 13)) {
+  if (BV_ISSET(fields, 9)) {
     dio_put_uint8(&dout, real_packet->min_dist_bw_cities);
   }
-  if (BV_ISSET(fields, 14)) {
+  if (BV_ISSET(fields, 10)) {
     dio_put_uint8(&dout, real_packet->init_vis_radius_sq);
   }
-  if (BV_ISSET(fields, 15)) {
+  if (BV_ISSET(fields, 11)) {
     dio_put_uint8(&dout, real_packet->hut_overflight);
   }
-  /* field 16 is folded into the header */
-  if (BV_ISSET(fields, 17)) {
+  /* field 12 is folded into the header */
+  if (BV_ISSET(fields, 13)) {
     dio_put_uint8(&dout, real_packet->nuke_contamination);
   }
-  if (BV_ISSET(fields, 18)) {
+  if (BV_ISSET(fields, 14)) {
   
     {
       int i;
@@ -22074,23 +22086,23 @@
       }
     } 
   }
-  if (BV_ISSET(fields, 19)) {
+  if (BV_ISSET(fields, 15)) {
     dio_put_uint8(&dout, real_packet->granary_num_inis);
   }
-  if (BV_ISSET(fields, 20)) {
+  if (BV_ISSET(fields, 16)) {
     dio_put_uint8(&dout, real_packet->granary_food_inc);
   }
-  if (BV_ISSET(fields, 21)) {
+  if (BV_ISSET(fields, 17)) {
     dio_put_uint8(&dout, real_packet->tech_cost_style);
   }
-  if (BV_ISSET(fields, 22)) {
+  if (BV_ISSET(fields, 18)) {
     dio_put_uint8(&dout, real_packet->tech_leakage);
   }
-  if (BV_ISSET(fields, 23)) {
+  if (BV_ISSET(fields, 19)) {
     dio_put_tech_list(&dout, real_packet->global_init_techs);
   }
-  /* field 24 is folded into the header */
-  if (BV_ISSET(fields, 25)) {
+  /* field 20 is folded into the header */
+  if (BV_ISSET(fields, 21)) {
   
     {
       int i;
@@ -22100,7 +22112,7 @@
       }
     } 
   }
-  if (BV_ISSET(fields, 26)) {
+  if (BV_ISSET(fields, 22)) {
   
     {
       int i;
@@ -22110,7 +22122,7 @@
       }
     } 
   }
-  if (BV_ISSET(fields, 27)) {
+  if (BV_ISSET(fields, 23)) {
   
     {
       int i;
@@ -22137,7 +22149,7 @@
 
 #define cmp_packet_ruleset_game_101 cmp_const
 
-BV_DEFINE(packet_ruleset_game_101_fields, 18);
+BV_DEFINE(packet_ruleset_game_101_fields, 20);
 
 static struct packet_ruleset_game *receive_packet_ruleset_game_101(struct 
connection *pc, enum packet_type type)
 {
@@ -22162,28 +22174,48 @@
   }
 
   if (BV_ISSET(fields, 0)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_city_center_food);
+    
+    {
+      int i;
+    
+      for (i = 0; i < T_COUNT; i++) {
+        dio_get_uint8(&din, (int *) &real_packet->specialist_min_size[i]);
+      }
+    }
   }
   if (BV_ISSET(fields, 1)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_city_center_shield);
+    
+    {
+      int i;
+    
+      for (i = 0; i < T_COUNT; i++) {
+        dio_get_uint8(&din, (int *) &real_packet->specialist_bonus[i]);
+      }
+    }
   }
   if (BV_ISSET(fields, 2)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_city_center_trade);
+    dio_get_uint8(&din, (int *) &real_packet->min_city_center_food);
   }
   if (BV_ISSET(fields, 3)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_dist_bw_cities);
+    dio_get_uint8(&din, (int *) &real_packet->min_city_center_shield);
   }
   if (BV_ISSET(fields, 4)) {
-    dio_get_uint8(&din, (int *) &real_packet->init_vis_radius_sq);
+    dio_get_uint8(&din, (int *) &real_packet->min_city_center_trade);
   }
   if (BV_ISSET(fields, 5)) {
-    dio_get_uint8(&din, (int *) &real_packet->hut_overflight);
+    dio_get_uint8(&din, (int *) &real_packet->min_dist_bw_cities);
+  }
+  if (BV_ISSET(fields, 6)) {
+    dio_get_uint8(&din, (int *) &real_packet->init_vis_radius_sq);
   }
-  real_packet->pillage_select = BV_ISSET(fields, 6);
   if (BV_ISSET(fields, 7)) {
+    dio_get_uint8(&din, (int *) &real_packet->hut_overflight);
+  }
+  real_packet->pillage_select = BV_ISSET(fields, 8);
+  if (BV_ISSET(fields, 9)) {
     dio_get_uint8(&din, (int *) &real_packet->nuke_contamination);
   }
-  if (BV_ISSET(fields, 8)) {
+  if (BV_ISSET(fields, 10)) {
     
     {
       int i;
@@ -22193,23 +22225,23 @@
       }
     }
   }
-  if (BV_ISSET(fields, 9)) {
+  if (BV_ISSET(fields, 11)) {
     dio_get_uint8(&din, (int *) &real_packet->granary_num_inis);
   }
-  if (BV_ISSET(fields, 10)) {
+  if (BV_ISSET(fields, 12)) {
     dio_get_uint8(&din, (int *) &real_packet->granary_food_inc);
   }
-  if (BV_ISSET(fields, 11)) {
+  if (BV_ISSET(fields, 13)) {
     dio_get_uint8(&din, (int *) &real_packet->tech_cost_style);
   }
-  if (BV_ISSET(fields, 12)) {
+  if (BV_ISSET(fields, 14)) {
     dio_get_uint8(&din, (int *) &real_packet->tech_leakage);
   }
-  if (BV_ISSET(fields, 13)) {
+  if (BV_ISSET(fields, 15)) {
     dio_get_tech_list(&din, real_packet->global_init_techs);
   }
-  real_packet->killstack = BV_ISSET(fields, 14);
-  if (BV_ISSET(fields, 15)) {
+  real_packet->killstack = BV_ISSET(fields, 16);
+  if (BV_ISSET(fields, 17)) {
     
     {
       int i;
@@ -22219,7 +22251,7 @@
       }
     }
   }
-  if (BV_ISSET(fields, 16)) {
+  if (BV_ISSET(fields, 18)) {
     
     {
       int i;
@@ -22229,7 +22261,7 @@
       }
     }
   }
-  if (BV_ISSET(fields, 17)) {
+  if (BV_ISSET(fields, 19)) {
     
     {
       int i;
@@ -22273,37 +22305,69 @@
     force_send_of_unchanged = TRUE;
   }
 
-  differ = (old->min_city_center_food != real_packet->min_city_center_food);
+
+    {
+      differ = (T_COUNT != T_COUNT);
+      if(!differ) {
+        int i;
+        for (i = 0; i < T_COUNT; i++) {
+          if (old->specialist_min_size[i] != 
real_packet->specialist_min_size[i]) {
+            differ = TRUE;
+            break;
+          }
+        }
+      }
+    }
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 0);}
 
-  differ = (old->min_city_center_shield != 
real_packet->min_city_center_shield);
+
+    {
+      differ = (T_COUNT != T_COUNT);
+      if(!differ) {
+        int i;
+        for (i = 0; i < T_COUNT; i++) {
+          if (old->specialist_bonus[i] != real_packet->specialist_bonus[i]) {
+            differ = TRUE;
+            break;
+          }
+        }
+      }
+    }
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 1);}
 
-  differ = (old->min_city_center_trade != real_packet->min_city_center_trade);
+  differ = (old->min_city_center_food != real_packet->min_city_center_food);
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 2);}
 
-  differ = (old->min_dist_bw_cities != real_packet->min_dist_bw_cities);
+  differ = (old->min_city_center_shield != 
real_packet->min_city_center_shield);
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 3);}
 
-  differ = (old->init_vis_radius_sq != real_packet->init_vis_radius_sq);
+  differ = (old->min_city_center_trade != real_packet->min_city_center_trade);
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 4);}
 
-  differ = (old->hut_overflight != real_packet->hut_overflight);
+  differ = (old->min_dist_bw_cities != real_packet->min_dist_bw_cities);
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 5);}
 
+  differ = (old->init_vis_radius_sq != real_packet->init_vis_radius_sq);
+  if(differ) {different++;}
+  if(differ) {BV_SET(fields, 6);}
+
+  differ = (old->hut_overflight != real_packet->hut_overflight);
+  if(differ) {different++;}
+  if(differ) {BV_SET(fields, 7);}
+
   differ = (old->pillage_select != real_packet->pillage_select);
   if(differ) {different++;}
-  if(packet->pillage_select) {BV_SET(fields, 6);}
+  if(packet->pillage_select) {BV_SET(fields, 8);}
 
   differ = (old->nuke_contamination != real_packet->nuke_contamination);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 7);}
+  if(differ) {BV_SET(fields, 9);}
 
 
     {
@@ -22319,23 +22383,23 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 8);}
+  if(differ) {BV_SET(fields, 10);}
 
   differ = (old->granary_num_inis != real_packet->granary_num_inis);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 9);}
+  if(differ) {BV_SET(fields, 11);}
 
   differ = (old->granary_food_inc != real_packet->granary_food_inc);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 10);}
+  if(differ) {BV_SET(fields, 12);}
 
   differ = (old->tech_cost_style != real_packet->tech_cost_style);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 11);}
+  if(differ) {BV_SET(fields, 13);}
 
   differ = (old->tech_leakage != real_packet->tech_leakage);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 12);}
+  if(differ) {BV_SET(fields, 14);}
 
 
     {
@@ -22351,11 +22415,11 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 13);}
+  if(differ) {BV_SET(fields, 15);}
 
   differ = (old->killstack != real_packet->killstack);
   if(differ) {different++;}
-  if(packet->killstack) {BV_SET(fields, 14);}
+  if(packet->killstack) {BV_SET(fields, 16);}
 
 
     {
@@ -22371,7 +22435,7 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 15);}
+  if(differ) {BV_SET(fields, 17);}
 
 
     {
@@ -22387,7 +22451,7 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 16);}
+  if(differ) {BV_SET(fields, 18);}
 
 
     {
@@ -22403,7 +22467,7 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 17);}
+  if(differ) {BV_SET(fields, 19);}
 
   if (different == 0 && !force_send_of_unchanged) {
     return 0;
@@ -22412,28 +22476,48 @@
   DIO_BV_PUT(&dout, fields);
 
   if (BV_ISSET(fields, 0)) {
-    dio_put_uint8(&dout, real_packet->min_city_center_food);
+  
+    {
+      int i;
+
+      for (i = 0; i < T_COUNT; i++) {
+        dio_put_uint8(&dout, real_packet->specialist_min_size[i]);
+      }
+    } 
   }
   if (BV_ISSET(fields, 1)) {
-    dio_put_uint8(&dout, real_packet->min_city_center_shield);
+  
+    {
+      int i;
+
+      for (i = 0; i < T_COUNT; i++) {
+        dio_put_uint8(&dout, real_packet->specialist_bonus[i]);
+      }
+    } 
   }
   if (BV_ISSET(fields, 2)) {
-    dio_put_uint8(&dout, real_packet->min_city_center_trade);
+    dio_put_uint8(&dout, real_packet->min_city_center_food);
   }
   if (BV_ISSET(fields, 3)) {
-    dio_put_uint8(&dout, real_packet->min_dist_bw_cities);
+    dio_put_uint8(&dout, real_packet->min_city_center_shield);
   }
   if (BV_ISSET(fields, 4)) {
-    dio_put_uint8(&dout, real_packet->init_vis_radius_sq);
+    dio_put_uint8(&dout, real_packet->min_city_center_trade);
   }
   if (BV_ISSET(fields, 5)) {
-    dio_put_uint8(&dout, real_packet->hut_overflight);
+    dio_put_uint8(&dout, real_packet->min_dist_bw_cities);
+  }
+  if (BV_ISSET(fields, 6)) {
+    dio_put_uint8(&dout, real_packet->init_vis_radius_sq);
   }
-  /* field 6 is folded into the header */
   if (BV_ISSET(fields, 7)) {
+    dio_put_uint8(&dout, real_packet->hut_overflight);
+  }
+  /* field 8 is folded into the header */
+  if (BV_ISSET(fields, 9)) {
     dio_put_uint8(&dout, real_packet->nuke_contamination);
   }
-  if (BV_ISSET(fields, 8)) {
+  if (BV_ISSET(fields, 10)) {
   
     {
       int i;
@@ -22443,23 +22527,23 @@
       }
     } 
   }
-  if (BV_ISSET(fields, 9)) {
+  if (BV_ISSET(fields, 11)) {
     dio_put_uint8(&dout, real_packet->granary_num_inis);
   }
-  if (BV_ISSET(fields, 10)) {
+  if (BV_ISSET(fields, 12)) {
     dio_put_uint8(&dout, real_packet->granary_food_inc);
   }
-  if (BV_ISSET(fields, 11)) {
+  if (BV_ISSET(fields, 13)) {
     dio_put_uint8(&dout, real_packet->tech_cost_style);
   }
-  if (BV_ISSET(fields, 12)) {
+  if (BV_ISSET(fields, 14)) {
     dio_put_uint8(&dout, real_packet->tech_leakage);
   }
-  if (BV_ISSET(fields, 13)) {
+  if (BV_ISSET(fields, 15)) {
     dio_put_tech_list(&dout, real_packet->global_init_techs);
   }
-  /* field 14 is folded into the header */
-  if (BV_ISSET(fields, 15)) {
+  /* field 16 is folded into the header */
+  if (BV_ISSET(fields, 17)) {
   
     {
       int i;
@@ -22469,7 +22553,7 @@
       }
     } 
   }
-  if (BV_ISSET(fields, 16)) {
+  if (BV_ISSET(fields, 18)) {
   
     {
       int i;
@@ -22479,7 +22563,7 @@
       }
     } 
   }
-  if (BV_ISSET(fields, 17)) {
+  if (BV_ISSET(fields, 19)) {
   
     {
       int i;
@@ -22506,7 +22590,7 @@
 
 #define cmp_packet_ruleset_game_102 cmp_const
 
-BV_DEFINE(packet_ruleset_game_102_fields, 25);
+BV_DEFINE(packet_ruleset_game_102_fields, 21);
 
 static struct packet_ruleset_game *receive_packet_ruleset_game_102(struct 
connection *pc, enum packet_type type)
 {
@@ -22531,56 +22615,58 @@
   }
 
   if (BV_ISSET(fields, 0)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_size_elvis);
+    
+    {
+      int i;
+    
+      for (i = 0; i < T_COUNT; i++) {
+        dio_get_uint8(&din, (int *) &real_packet->specialist_min_size[i]);
+      }
+    }
   }
   if (BV_ISSET(fields, 1)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_size_taxman);
-  }
-  if (BV_ISSET(fields, 2)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_size_scientist);
+    
+    {
+      int i;
+    
+      for (i = 0; i < T_COUNT; i++) {
+        dio_get_uint8(&din, (int *) &real_packet->specialist_bonus[i]);
+      }
+    }
   }
+  real_packet->changable_tax = BV_ISSET(fields, 2);
   if (BV_ISSET(fields, 3)) {
-    dio_get_uint8(&din, (int *) &real_packet->base_elvis);
-  }
-  if (BV_ISSET(fields, 4)) {
-    dio_get_uint8(&din, (int *) &real_packet->base_scientist);
-  }
-  if (BV_ISSET(fields, 5)) {
-    dio_get_uint8(&din, (int *) &real_packet->base_taxman);
-  }
-  real_packet->changable_tax = BV_ISSET(fields, 6);
-  if (BV_ISSET(fields, 7)) {
     dio_get_uint8(&din, (int *) &real_packet->forced_science);
   }
-  if (BV_ISSET(fields, 8)) {
+  if (BV_ISSET(fields, 4)) {
     dio_get_uint8(&din, (int *) &real_packet->forced_luxury);
   }
-  if (BV_ISSET(fields, 9)) {
+  if (BV_ISSET(fields, 5)) {
     dio_get_uint8(&din, (int *) &real_packet->forced_gold);
   }
-  if (BV_ISSET(fields, 10)) {
+  if (BV_ISSET(fields, 6)) {
     dio_get_uint8(&din, (int *) &real_packet->min_city_center_food);
   }
-  if (BV_ISSET(fields, 11)) {
+  if (BV_ISSET(fields, 7)) {
     dio_get_uint8(&din, (int *) &real_packet->min_city_center_shield);
   }
-  if (BV_ISSET(fields, 12)) {
+  if (BV_ISSET(fields, 8)) {
     dio_get_uint8(&din, (int *) &real_packet->min_city_center_trade);
   }
-  if (BV_ISSET(fields, 13)) {
+  if (BV_ISSET(fields, 9)) {
     dio_get_uint8(&din, (int *) &real_packet->min_dist_bw_cities);
   }
-  if (BV_ISSET(fields, 14)) {
+  if (BV_ISSET(fields, 10)) {
     dio_get_uint8(&din, (int *) &real_packet->init_vis_radius_sq);
   }
-  if (BV_ISSET(fields, 15)) {
+  if (BV_ISSET(fields, 11)) {
     dio_get_uint8(&din, (int *) &real_packet->hut_overflight);
   }
-  real_packet->pillage_select = BV_ISSET(fields, 16);
-  if (BV_ISSET(fields, 17)) {
+  real_packet->pillage_select = BV_ISSET(fields, 12);
+  if (BV_ISSET(fields, 13)) {
     dio_get_uint8(&din, (int *) &real_packet->nuke_contamination);
   }
-  if (BV_ISSET(fields, 18)) {
+  if (BV_ISSET(fields, 14)) {
     
     {
       int i;
@@ -22590,22 +22676,22 @@
       }
     }
   }
-  if (BV_ISSET(fields, 19)) {
+  if (BV_ISSET(fields, 15)) {
     dio_get_uint8(&din, (int *) &real_packet->granary_num_inis);
   }
-  if (BV_ISSET(fields, 20)) {
+  if (BV_ISSET(fields, 16)) {
     dio_get_uint8(&din, (int *) &real_packet->granary_food_inc);
   }
-  if (BV_ISSET(fields, 21)) {
+  if (BV_ISSET(fields, 17)) {
     dio_get_uint8(&din, (int *) &real_packet->tech_cost_style);
   }
-  if (BV_ISSET(fields, 22)) {
+  if (BV_ISSET(fields, 18)) {
     dio_get_uint8(&din, (int *) &real_packet->tech_leakage);
   }
-  if (BV_ISSET(fields, 23)) {
+  if (BV_ISSET(fields, 19)) {
     dio_get_tech_list(&din, real_packet->global_init_techs);
   }
-  real_packet->killstack = BV_ISSET(fields, 24);
+  real_packet->killstack = BV_ISSET(fields, 20);
 
   clone = fc_malloc(sizeof(*clone));
   *clone = *real_packet;
@@ -22640,77 +22726,85 @@
     force_send_of_unchanged = TRUE;
   }
 
-  differ = (old->min_size_elvis != real_packet->min_size_elvis);
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 0);}
-
-  differ = (old->min_size_taxman != real_packet->min_size_taxman);
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 1);}
-
-  differ = (old->min_size_scientist != real_packet->min_size_scientist);
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 2);}
 
-  differ = (old->base_elvis != real_packet->base_elvis);
+    {
+      differ = (T_COUNT != T_COUNT);
+      if(!differ) {
+        int i;
+        for (i = 0; i < T_COUNT; i++) {
+          if (old->specialist_min_size[i] != 
real_packet->specialist_min_size[i]) {
+            differ = TRUE;
+            break;
+          }
+        }
+      }
+    }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 3);}
+  if(differ) {BV_SET(fields, 0);}
 
-  differ = (old->base_scientist != real_packet->base_scientist);
-  if(differ) {different++;}
-  if(differ) {BV_SET(fields, 4);}
 
-  differ = (old->base_taxman != real_packet->base_taxman);
+    {
+      differ = (T_COUNT != T_COUNT);
+      if(!differ) {
+        int i;
+        for (i = 0; i < T_COUNT; i++) {
+          if (old->specialist_bonus[i] != real_packet->specialist_bonus[i]) {
+            differ = TRUE;
+            break;
+          }
+        }
+      }
+    }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 5);}
+  if(differ) {BV_SET(fields, 1);}
 
   differ = (old->changable_tax != real_packet->changable_tax);
   if(differ) {different++;}
-  if(packet->changable_tax) {BV_SET(fields, 6);}
+  if(packet->changable_tax) {BV_SET(fields, 2);}
 
   differ = (old->forced_science != real_packet->forced_science);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 7);}
+  if(differ) {BV_SET(fields, 3);}
 
   differ = (old->forced_luxury != real_packet->forced_luxury);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 8);}
+  if(differ) {BV_SET(fields, 4);}
 
   differ = (old->forced_gold != real_packet->forced_gold);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 9);}
+  if(differ) {BV_SET(fields, 5);}
 
   differ = (old->min_city_center_food != real_packet->min_city_center_food);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 10);}
+  if(differ) {BV_SET(fields, 6);}
 
   differ = (old->min_city_center_shield != 
real_packet->min_city_center_shield);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 11);}
+  if(differ) {BV_SET(fields, 7);}
 
   differ = (old->min_city_center_trade != real_packet->min_city_center_trade);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 12);}
+  if(differ) {BV_SET(fields, 8);}
 
   differ = (old->min_dist_bw_cities != real_packet->min_dist_bw_cities);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 13);}
+  if(differ) {BV_SET(fields, 9);}
 
   differ = (old->init_vis_radius_sq != real_packet->init_vis_radius_sq);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 14);}
+  if(differ) {BV_SET(fields, 10);}
 
   differ = (old->hut_overflight != real_packet->hut_overflight);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 15);}
+  if(differ) {BV_SET(fields, 11);}
 
   differ = (old->pillage_select != real_packet->pillage_select);
   if(differ) {different++;}
-  if(packet->pillage_select) {BV_SET(fields, 16);}
+  if(packet->pillage_select) {BV_SET(fields, 12);}
 
   differ = (old->nuke_contamination != real_packet->nuke_contamination);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 17);}
+  if(differ) {BV_SET(fields, 13);}
 
 
     {
@@ -22726,23 +22820,23 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 18);}
+  if(differ) {BV_SET(fields, 14);}
 
   differ = (old->granary_num_inis != real_packet->granary_num_inis);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 19);}
+  if(differ) {BV_SET(fields, 15);}
 
   differ = (old->granary_food_inc != real_packet->granary_food_inc);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 20);}
+  if(differ) {BV_SET(fields, 16);}
 
   differ = (old->tech_cost_style != real_packet->tech_cost_style);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 21);}
+  if(differ) {BV_SET(fields, 17);}
 
   differ = (old->tech_leakage != real_packet->tech_leakage);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 22);}
+  if(differ) {BV_SET(fields, 18);}
 
 
     {
@@ -22758,11 +22852,11 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 23);}
+  if(differ) {BV_SET(fields, 19);}
 
   differ = (old->killstack != real_packet->killstack);
   if(differ) {different++;}
-  if(packet->killstack) {BV_SET(fields, 24);}
+  if(packet->killstack) {BV_SET(fields, 20);}
 
   if (different == 0 && !force_send_of_unchanged) {
     return 0;
@@ -22771,56 +22865,58 @@
   DIO_BV_PUT(&dout, fields);
 
   if (BV_ISSET(fields, 0)) {
-    dio_put_uint8(&dout, real_packet->min_size_elvis);
+  
+    {
+      int i;
+
+      for (i = 0; i < T_COUNT; i++) {
+        dio_put_uint8(&dout, real_packet->specialist_min_size[i]);
+      }
+    } 
   }
   if (BV_ISSET(fields, 1)) {
-    dio_put_uint8(&dout, real_packet->min_size_taxman);
-  }
-  if (BV_ISSET(fields, 2)) {
-    dio_put_uint8(&dout, real_packet->min_size_scientist);
+  
+    {
+      int i;
+
+      for (i = 0; i < T_COUNT; i++) {
+        dio_put_uint8(&dout, real_packet->specialist_bonus[i]);
+      }
+    } 
   }
+  /* field 2 is folded into the header */
   if (BV_ISSET(fields, 3)) {
-    dio_put_uint8(&dout, real_packet->base_elvis);
-  }
-  if (BV_ISSET(fields, 4)) {
-    dio_put_uint8(&dout, real_packet->base_scientist);
-  }
-  if (BV_ISSET(fields, 5)) {
-    dio_put_uint8(&dout, real_packet->base_taxman);
-  }
-  /* field 6 is folded into the header */
-  if (BV_ISSET(fields, 7)) {
     dio_put_uint8(&dout, real_packet->forced_science);
   }
-  if (BV_ISSET(fields, 8)) {
+  if (BV_ISSET(fields, 4)) {
     dio_put_uint8(&dout, real_packet->forced_luxury);
   }
-  if (BV_ISSET(fields, 9)) {
+  if (BV_ISSET(fields, 5)) {
     dio_put_uint8(&dout, real_packet->forced_gold);
   }
-  if (BV_ISSET(fields, 10)) {
+  if (BV_ISSET(fields, 6)) {
     dio_put_uint8(&dout, real_packet->min_city_center_food);
   }
-  if (BV_ISSET(fields, 11)) {
+  if (BV_ISSET(fields, 7)) {
     dio_put_uint8(&dout, real_packet->min_city_center_shield);
   }
-  if (BV_ISSET(fields, 12)) {
+  if (BV_ISSET(fields, 8)) {
     dio_put_uint8(&dout, real_packet->min_city_center_trade);
   }
-  if (BV_ISSET(fields, 13)) {
+  if (BV_ISSET(fields, 9)) {
     dio_put_uint8(&dout, real_packet->min_dist_bw_cities);
   }
-  if (BV_ISSET(fields, 14)) {
+  if (BV_ISSET(fields, 10)) {
     dio_put_uint8(&dout, real_packet->init_vis_radius_sq);
   }
-  if (BV_ISSET(fields, 15)) {
+  if (BV_ISSET(fields, 11)) {
     dio_put_uint8(&dout, real_packet->hut_overflight);
   }
-  /* field 16 is folded into the header */
-  if (BV_ISSET(fields, 17)) {
+  /* field 12 is folded into the header */
+  if (BV_ISSET(fields, 13)) {
     dio_put_uint8(&dout, real_packet->nuke_contamination);
   }
-  if (BV_ISSET(fields, 18)) {
+  if (BV_ISSET(fields, 14)) {
   
     {
       int i;
@@ -22830,22 +22926,22 @@
       }
     } 
   }
-  if (BV_ISSET(fields, 19)) {
+  if (BV_ISSET(fields, 15)) {
     dio_put_uint8(&dout, real_packet->granary_num_inis);
   }
-  if (BV_ISSET(fields, 20)) {
+  if (BV_ISSET(fields, 16)) {
     dio_put_uint8(&dout, real_packet->granary_food_inc);
   }
-  if (BV_ISSET(fields, 21)) {
+  if (BV_ISSET(fields, 17)) {
     dio_put_uint8(&dout, real_packet->tech_cost_style);
   }
-  if (BV_ISSET(fields, 22)) {
+  if (BV_ISSET(fields, 18)) {
     dio_put_uint8(&dout, real_packet->tech_leakage);
   }
-  if (BV_ISSET(fields, 23)) {
+  if (BV_ISSET(fields, 19)) {
     dio_put_tech_list(&dout, real_packet->global_init_techs);
   }
-  /* field 24 is folded into the header */
+  /* field 20 is folded into the header */
 
 
   if (old_from_hash) {
@@ -22863,7 +22959,7 @@
 
 #define cmp_packet_ruleset_game_103 cmp_const
 
-BV_DEFINE(packet_ruleset_game_103_fields, 15);
+BV_DEFINE(packet_ruleset_game_103_fields, 17);
 
 static struct packet_ruleset_game *receive_packet_ruleset_game_103(struct 
connection *pc, enum packet_type type)
 {
@@ -22888,28 +22984,48 @@
   }
 
   if (BV_ISSET(fields, 0)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_city_center_food);
+    
+    {
+      int i;
+    
+      for (i = 0; i < T_COUNT; i++) {
+        dio_get_uint8(&din, (int *) &real_packet->specialist_min_size[i]);
+      }
+    }
   }
   if (BV_ISSET(fields, 1)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_city_center_shield);
+    
+    {
+      int i;
+    
+      for (i = 0; i < T_COUNT; i++) {
+        dio_get_uint8(&din, (int *) &real_packet->specialist_bonus[i]);
+      }
+    }
   }
   if (BV_ISSET(fields, 2)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_city_center_trade);
+    dio_get_uint8(&din, (int *) &real_packet->min_city_center_food);
   }
   if (BV_ISSET(fields, 3)) {
-    dio_get_uint8(&din, (int *) &real_packet->min_dist_bw_cities);
+    dio_get_uint8(&din, (int *) &real_packet->min_city_center_shield);
   }
   if (BV_ISSET(fields, 4)) {
-    dio_get_uint8(&din, (int *) &real_packet->init_vis_radius_sq);
+    dio_get_uint8(&din, (int *) &real_packet->min_city_center_trade);
   }
   if (BV_ISSET(fields, 5)) {
-    dio_get_uint8(&din, (int *) &real_packet->hut_overflight);
+    dio_get_uint8(&din, (int *) &real_packet->min_dist_bw_cities);
+  }
+  if (BV_ISSET(fields, 6)) {
+    dio_get_uint8(&din, (int *) &real_packet->init_vis_radius_sq);
   }
-  real_packet->pillage_select = BV_ISSET(fields, 6);
   if (BV_ISSET(fields, 7)) {
+    dio_get_uint8(&din, (int *) &real_packet->hut_overflight);
+  }
+  real_packet->pillage_select = BV_ISSET(fields, 8);
+  if (BV_ISSET(fields, 9)) {
     dio_get_uint8(&din, (int *) &real_packet->nuke_contamination);
   }
-  if (BV_ISSET(fields, 8)) {
+  if (BV_ISSET(fields, 10)) {
     
     {
       int i;
@@ -22919,22 +23035,22 @@
       }
     }
   }
-  if (BV_ISSET(fields, 9)) {
+  if (BV_ISSET(fields, 11)) {
     dio_get_uint8(&din, (int *) &real_packet->granary_num_inis);
   }
-  if (BV_ISSET(fields, 10)) {
+  if (BV_ISSET(fields, 12)) {
     dio_get_uint8(&din, (int *) &real_packet->granary_food_inc);
   }
-  if (BV_ISSET(fields, 11)) {
+  if (BV_ISSET(fields, 13)) {
     dio_get_uint8(&din, (int *) &real_packet->tech_cost_style);
   }
-  if (BV_ISSET(fields, 12)) {
+  if (BV_ISSET(fields, 14)) {
     dio_get_uint8(&din, (int *) &real_packet->tech_leakage);
   }
-  if (BV_ISSET(fields, 13)) {
+  if (BV_ISSET(fields, 15)) {
     dio_get_tech_list(&din, real_packet->global_init_techs);
   }
-  real_packet->killstack = BV_ISSET(fields, 14);
+  real_packet->killstack = BV_ISSET(fields, 16);
 
   clone = fc_malloc(sizeof(*clone));
   *clone = *real_packet;
@@ -22969,37 +23085,69 @@
     force_send_of_unchanged = TRUE;
   }
 
-  differ = (old->min_city_center_food != real_packet->min_city_center_food);
+
+    {
+      differ = (T_COUNT != T_COUNT);
+      if(!differ) {
+        int i;
+        for (i = 0; i < T_COUNT; i++) {
+          if (old->specialist_min_size[i] != 
real_packet->specialist_min_size[i]) {
+            differ = TRUE;
+            break;
+          }
+        }
+      }
+    }
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 0);}
 
-  differ = (old->min_city_center_shield != 
real_packet->min_city_center_shield);
+
+    {
+      differ = (T_COUNT != T_COUNT);
+      if(!differ) {
+        int i;
+        for (i = 0; i < T_COUNT; i++) {
+          if (old->specialist_bonus[i] != real_packet->specialist_bonus[i]) {
+            differ = TRUE;
+            break;
+          }
+        }
+      }
+    }
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 1);}
 
-  differ = (old->min_city_center_trade != real_packet->min_city_center_trade);
+  differ = (old->min_city_center_food != real_packet->min_city_center_food);
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 2);}
 
-  differ = (old->min_dist_bw_cities != real_packet->min_dist_bw_cities);
+  differ = (old->min_city_center_shield != 
real_packet->min_city_center_shield);
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 3);}
 
-  differ = (old->init_vis_radius_sq != real_packet->init_vis_radius_sq);
+  differ = (old->min_city_center_trade != real_packet->min_city_center_trade);
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 4);}
 
-  differ = (old->hut_overflight != real_packet->hut_overflight);
+  differ = (old->min_dist_bw_cities != real_packet->min_dist_bw_cities);
   if(differ) {different++;}
   if(differ) {BV_SET(fields, 5);}
 
+  differ = (old->init_vis_radius_sq != real_packet->init_vis_radius_sq);
+  if(differ) {different++;}
+  if(differ) {BV_SET(fields, 6);}
+
+  differ = (old->hut_overflight != real_packet->hut_overflight);
+  if(differ) {different++;}
+  if(differ) {BV_SET(fields, 7);}
+
   differ = (old->pillage_select != real_packet->pillage_select);
   if(differ) {different++;}
-  if(packet->pillage_select) {BV_SET(fields, 6);}
+  if(packet->pillage_select) {BV_SET(fields, 8);}
 
   differ = (old->nuke_contamination != real_packet->nuke_contamination);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 7);}
+  if(differ) {BV_SET(fields, 9);}
 
 
     {
@@ -23015,23 +23163,23 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 8);}
+  if(differ) {BV_SET(fields, 10);}
 
   differ = (old->granary_num_inis != real_packet->granary_num_inis);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 9);}
+  if(differ) {BV_SET(fields, 11);}
 
   differ = (old->granary_food_inc != real_packet->granary_food_inc);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 10);}
+  if(differ) {BV_SET(fields, 12);}
 
   differ = (old->tech_cost_style != real_packet->tech_cost_style);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 11);}
+  if(differ) {BV_SET(fields, 13);}
 
   differ = (old->tech_leakage != real_packet->tech_leakage);
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 12);}
+  if(differ) {BV_SET(fields, 14);}
 
 
     {
@@ -23047,11 +23195,11 @@
       }
     }
   if(differ) {different++;}
-  if(differ) {BV_SET(fields, 13);}
+  if(differ) {BV_SET(fields, 15);}
 
   differ = (old->killstack != real_packet->killstack);
   if(differ) {different++;}
-  if(packet->killstack) {BV_SET(fields, 14);}
+  if(packet->killstack) {BV_SET(fields, 16);}
 
   if (different == 0 && !force_send_of_unchanged) {
     return 0;
@@ -23060,28 +23208,48 @@
   DIO_BV_PUT(&dout, fields);
 
   if (BV_ISSET(fields, 0)) {
-    dio_put_uint8(&dout, real_packet->min_city_center_food);
+  
+    {
+      int i;
+
+      for (i = 0; i < T_COUNT; i++) {
+        dio_put_uint8(&dout, real_packet->specialist_min_size[i]);
+      }
+    } 
   }
   if (BV_ISSET(fields, 1)) {
-    dio_put_uint8(&dout, real_packet->min_city_center_shield);
+  
+    {
+      int i;
+
+      for (i = 0; i < T_COUNT; i++) {
+        dio_put_uint8(&dout, real_packet->specialist_bonus[i]);
+      }
+    } 
   }
   if (BV_ISSET(fields, 2)) {
-    dio_put_uint8(&dout, real_packet->min_city_center_trade);
+    dio_put_uint8(&dout, real_packet->min_city_center_food);
   }
   if (BV_ISSET(fields, 3)) {
-    dio_put_uint8(&dout, real_packet->min_dist_bw_cities);
+    dio_put_uint8(&dout, real_packet->min_city_center_shield);
   }
   if (BV_ISSET(fields, 4)) {
-    dio_put_uint8(&dout, real_packet->init_vis_radius_sq);
+    dio_put_uint8(&dout, real_packet->min_city_center_trade);
   }
   if (BV_ISSET(fields, 5)) {
-    dio_put_uint8(&dout, real_packet->hut_overflight);
+    dio_put_uint8(&dout, real_packet->min_dist_bw_cities);
+  }
+  if (BV_ISSET(fields, 6)) {
+    dio_put_uint8(&dout, real_packet->init_vis_radius_sq);
   }
-  /* field 6 is folded into the header */
   if (BV_ISSET(fields, 7)) {
+    dio_put_uint8(&dout, real_packet->hut_overflight);
+  }
+  /* field 8 is folded into the header */
+  if (BV_ISSET(fields, 9)) {
     dio_put_uint8(&dout, real_packet->nuke_contamination);
   }
-  if (BV_ISSET(fields, 8)) {
+  if (BV_ISSET(fields, 10)) {
   
     {
       int i;
@@ -23091,22 +23259,22 @@
       }
     } 
   }
-  if (BV_ISSET(fields, 9)) {
+  if (BV_ISSET(fields, 11)) {
     dio_put_uint8(&dout, real_packet->granary_num_inis);
   }
-  if (BV_ISSET(fields, 10)) {
+  if (BV_ISSET(fields, 12)) {
     dio_put_uint8(&dout, real_packet->granary_food_inc);
   }
-  if (BV_ISSET(fields, 11)) {
+  if (BV_ISSET(fields, 13)) {
     dio_put_uint8(&dout, real_packet->tech_cost_style);
   }
-  if (BV_ISSET(fields, 12)) {
+  if (BV_ISSET(fields, 14)) {
     dio_put_uint8(&dout, real_packet->tech_leakage);
   }
-  if (BV_ISSET(fields, 13)) {
+  if (BV_ISSET(fields, 15)) {
     dio_put_tech_list(&dout, real_packet->global_init_techs);
   }
-  /* field 14 is folded into the header */
+  /* field 16 is folded into the header */
 
 
   if (old_from_hash) {
Index: common/packets_gen.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets_gen.h,v
retrieving revision 1.22
diff -u -r1.22 packets_gen.h
--- common/packets_gen.h        27 May 2004 22:14:19 -0000      1.22
+++ common/packets_gen.h        30 May 2004 04:24:15 -0000
@@ -736,12 +736,8 @@
 };
 
 struct packet_ruleset_game {
-  int min_size_elvis;
-  int min_size_taxman;
-  int min_size_scientist;
-  int base_elvis;
-  int base_scientist;
-  int base_taxman;
+  int specialist_min_size[T_COUNT];
+  int specialist_bonus[T_COUNT];
   bool changable_tax;
   int forced_science;
   int forced_luxury;
Index: server/cityhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityhand.c,v
retrieving revision 1.130
diff -u -r1.130 cityhand.c
--- server/cityhand.c   29 May 2004 20:57:16 -0000      1.130
+++ server/cityhand.c   30 May 2004 04:24:16 -0000
@@ -74,9 +74,7 @@
 
   if (to < 0 || to >= SP_COUNT
       || from < 0 || from >= SP_COUNT
-      || (to == SP_ELVIS && pcity->size < game.rgame.min_size_elvis)
-      || (to == SP_TAXMAN && pcity->size < game.rgame.min_size_taxman)
-      || (to == SP_SCIENTIST && pcity->size < game.rgame.min_size_scientist)
+      || pcity->size < game.rgame.specialists[to].min_size
       || pcity->specialists[from] == 0) {
     freelog(LOG_ERROR, "Error in specialist change request from client.");
     return;
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.173
diff -u -r1.173 ruleset.c
--- server/ruleset.c    23 May 2004 17:06:42 -0000      1.173
+++ server/ruleset.c    30 May 2004 04:24:17 -0000
@@ -2495,17 +2495,17 @@
 
   /* Specialist options */
 
-  game.rgame.min_size_elvis = 
+  game.rgame.specialists[SP_ELVIS].min_size =
     secfile_lookup_int_default(file, 0, "specialist.min_size_elvis");
-  game.rgame.min_size_taxman = 
-    secfile_lookup_int_default(file, 5, "specialist.min_size_taxman");
-  game.rgame.min_size_scientist = 
+  game.rgame.specialists[SP_SCIENTIST].min_size =
     secfile_lookup_int_default(file, 5, "specialist.min_size_scientist");
-  game.rgame.base_elvis = 
+  game.rgame.specialists[SP_TAXMAN].min_size =
+    secfile_lookup_int_default(file, 5, "specialist.min_size_taxman");
+  game.rgame.specialists[SP_ELVIS].bonus =
     secfile_lookup_int_default(file, 2, "specialist.base_elvis");
-  game.rgame.base_scientist = 
+  game.rgame.specialists[SP_SCIENTIST].bonus =
     secfile_lookup_int_default(file, 3, "specialist.base_scientist");
-  game.rgame.base_taxman = 
+  game.rgame.specialists[SP_TAXMAN].bonus =
     secfile_lookup_int_default(file, 3, "specialist.base_taxman");
   game.rgame.changable_tax = 
     secfile_lookup_bool_default(file, TRUE, "specialist.changable_tax");
@@ -2520,9 +2520,8 @@
     freelog(LOG_FATAL, "Forced taxes do not add up in ruleset!");
     exit(EXIT_FAILURE);
   }
-  if (game.rgame.min_size_elvis > 0 && game.rgame.min_size_taxman > 0
-      && game.rgame.min_size_scientist > 0) {
-    freelog(LOG_FATAL, "At least one specialist must be available without a "
+  if (game.rgame.specialists[SP_ELVIS].min_size > 0) {
+    freelog(LOG_FATAL, "Elvises must be available without a "
            "city size restriction!");
     exit(EXIT_FAILURE);
   }
@@ -3095,12 +3094,10 @@
   int i;
   struct packet_ruleset_game misc_p;
 
-  misc_p.min_size_elvis = game.rgame.min_size_elvis;
-  misc_p.min_size_taxman = game.rgame.min_size_taxman;
-  misc_p.min_size_scientist = game.rgame.min_size_scientist;
-  misc_p.base_elvis = game.rgame.base_elvis;
-  misc_p.base_scientist = game.rgame.base_scientist;
-  misc_p.base_taxman = game.rgame.base_taxman;
+  for (i = 0; i < T_COUNT; i++) {
+    misc_p.specialist_min_size[i] = game.rgame.specialists[i].min_size;
+    misc_p.specialist_bonus[i] = game.rgame.specialists[i].bonus;
+  }
   misc_p.changable_tax = game.rgame.changable_tax;
   misc_p.forced_science = game.rgame.forced_science;
   misc_p.forced_luxury = game.rgame.forced_luxury;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#8871) put specialist configuration info into an array, Jason Short <=