Author: cazfi
Date: Tue Jun 28 06:48:13 2016
New Revision: 33068

URL: http://svn.gna.org/viewcvs/freeciv?rev=33068&view=rev
Log:
Send unit classs non_native_def_pct to the client, so winning chance
display for units on non-native terrain is shown correctly.

Reported by Fomalhaut

See bug #24799

Modified:
    trunk/client/packhand.c
    trunk/common/networking/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=33068&r1=33067&r2=33068&view=diff
==============================================================================
--- trunk/client/packhand.c     (original)
+++ trunk/client/packhand.c     Tue Jun 28 06:48:13 2016
@@ -3221,10 +3221,11 @@
   fc_assert_ret_msg(NULL != c, "Bad unit_class %d.", p->id);
 
   names_set(&c->name, NULL, p->name, p->rule_name);
-  c->min_speed   = p->min_speed;
-  c->hp_loss_pct = p->hp_loss_pct;
-  c->hut_behavior = p->hut_behavior;
-  c->flags       = p->flags;
+  c->min_speed          = p->min_speed;
+  c->hp_loss_pct        = p->hp_loss_pct;
+  c->hut_behavior       = p->hut_behavior;
+  c->non_native_def_pct = p->non_native_def_pct;
+  c->flags              = p->flags;
 
   PACKET_STRVEC_EXTRACT(c->helptext, p->helptext);
 }

Modified: trunk/common/networking/packets.def
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/networking/packets.def?rev=33068&r1=33067&r2=33068&view=diff
==============================================================================
--- trunk/common/networking/packets.def (original)
+++ trunk/common/networking/packets.def Tue Jun 28 06:48:13 2016
@@ -1605,6 +1605,7 @@
   MOVEFRAGS min_speed;
   UINT8 hp_loss_pct;
   UINT8 hut_behavior;
+  UINT16 non_native_def_pct;
   BV_UCLASS_FLAGS flags;
 
   STRVEC helptext[MAX_LEN_PACKET];

Modified: trunk/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=33068&r1=33067&r2=33068&view=diff
==============================================================================
--- trunk/fc_version    (original)
+++ trunk/fc_version    Tue Jun 28 06:48:13 2016
@@ -56,7 +56,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-2016.Jun.26"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Jun.28"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""

Modified: trunk/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/ruleset.c?rev=33068&r1=33067&r2=33068&view=diff
==============================================================================
--- trunk/server/ruleset.c      (original)
+++ trunk/server/ruleset.c      Tue Jun 28 06:48:13 2016
@@ -6481,6 +6481,7 @@
     packet.min_speed = c->min_speed;
     packet.hp_loss_pct = c->hp_loss_pct;
     packet.hut_behavior = c->hut_behavior;
+    packet.non_native_def_pct = c->non_native_def_pct;
     packet.flags = c->flags;
 
     PACKET_STRVEC_COMPUTE(packet.helptext, c->helptext);


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

Reply via email to