Author: cazfi
Date: Wed Dec 16 20:18:53 2015
New Revision: 31022

URL: http://svn.gna.org/viewcvs/freeciv?rev=31022&view=rev
Log:
Transfer extra cause EC_RESOURCE correctly to client side

See patch #6678

Modified:
    trunk/client/packhand.c
    trunk/common/packets.def
    trunk/fc_version
    trunk/server/ruleset.c

Modified: trunk/client/packhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/packhand.c?rev=31022&r1=31021&r2=31022&view=diff
==============================================================================
--- trunk/client/packhand.c     (original)
+++ trunk/client/packhand.c     Wed Dec 16 20:18:53 2015
@@ -3526,6 +3526,7 @@
   int i;
   bool cbase;
   bool croad;
+  bool cres;
 
   fc_assert_ret_msg(NULL != pextra, "Bad extra %d.", p->id);
 
@@ -3549,6 +3550,7 @@
 
   cbase = is_extra_caused_by(pextra, EC_BASE);
   croad = is_extra_caused_by(pextra, EC_ROAD);
+  cres  = is_extra_caused_by(pextra, EC_RESOURCE);
   if (cbase) {
     /* Index is one less than size of list when this base is already added. */
     base_type_init(pextra, 
extra_type_list_size(extra_type_list_by_cause(EC_BASE)) - 1);
@@ -3557,7 +3559,7 @@
     /* Index is one less than size of list when this road is already added. */
     road_type_init(pextra, 
extra_type_list_size(extra_type_list_by_cause(EC_ROAD)) - 1);
   }
-  if (!cbase && !croad) {
+  if (!cbase && !croad && !cres) {
     pextra->data.special_idx = 
extra_type_list_size(extra_type_list_by_cause(EC_SPECIAL));
     extra_to_caused_by_list(pextra, EC_SPECIAL);
   }

Modified: trunk/common/packets.def
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/packets.def?rev=31022&r1=31021&r2=31022&view=diff
==============================================================================
--- trunk/common/packets.def    (original)
+++ trunk/common/packets.def    Wed Dec 16 20:18:53 2015
@@ -1590,7 +1590,7 @@
   STRING name[MAX_LEN_NAME];
   STRING rule_name[MAX_LEN_NAME];
   UINT8 category;
-  UINT8 causes;
+  UINT16 causes;
   UINT8 rmcauses;
   STRING activity_gfx[MAX_LEN_NAME];
   STRING act_gfx_alt[MAX_LEN_NAME];

Modified: trunk/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=31022&r1=31021&r2=31022&view=diff
==============================================================================
--- trunk/fc_version    (original)
+++ trunk/fc_version    Wed Dec 16 20:18:53 2015
@@ -54,7 +54,7 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2015.Dec.14"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2015.Dec.16"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""

Modified: trunk/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/ruleset.c?rev=31022&r1=31021&r2=31022&view=diff
==============================================================================
--- trunk/server/ruleset.c      (original)
+++ trunk/server/ruleset.c      Wed Dec 16 20:18:53 2015
@@ -2872,8 +2872,9 @@
         }
 
         if (!is_extra_caused_by(pextra, EC_BASE)
-            && !is_extra_caused_by(pextra, EC_ROAD)) {
-          /* Not a base nor road, so special */
+            && !is_extra_caused_by(pextra, EC_ROAD)
+            && !is_extra_caused_by(pextra, EC_RESOURCE)) {
+          /* Not a base, road, nor resource, so special */
           pextra->data.special_idx = 
extra_type_list_size(extra_type_list_by_cause(EC_SPECIAL));
           extra_to_caused_by_list(pextra, EC_SPECIAL);
         }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to