Author: jtn
Date: Fri Dec 18 21:13:03 2015
New Revision: 31080

URL: http://svn.gna.org/viewcvs/freeciv?rev=31080&view=rev
Log:
Remove editor's clipping of moves left to unit move_rate, since effects
and veterancy allow it to be greater.

See gna bug #24079.

Modified:
    branches/S2_6/client/gui-gtk-2.0/editprop.c
    branches/S2_6/client/gui-gtk-3.0/editprop.c
    branches/S2_6/server/edithand.c

Modified: branches/S2_6/client/gui-gtk-2.0/editprop.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-2.0/editprop.c?rev=31080&r1=31079&r2=31080&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-2.0/editprop.c (original)
+++ branches/S2_6/client/gui-gtk-2.0/editprop.c Fri Dec 18 21:13:03 2015
@@ -1897,7 +1897,7 @@
       switch (propid) {
       case OPID_UNIT_MOVES_LEFT:
         *pmin = 0;
-        *pmax = putype->move_rate;
+        *pmax = 65535; /* packets.def MOVEFRAGS */
         *pstep = 1;
         *pbig_step = 5;
         return TRUE;
@@ -2938,6 +2938,7 @@
     objprop_set_child_widget(op, "entry", entry);
     return;
 
+  case OPID_UNIT_MOVES_LEFT:
   case OPID_CITY_SIZE:
   case OPID_CITY_HISTORY:
   case OPID_CITY_SHIELD_STOCK:
@@ -2951,7 +2952,6 @@
     objprop_set_child_widget(op, "spin", spin);
     return;
 
-  case OPID_UNIT_MOVES_LEFT:
   case OPID_UNIT_FUEL:
   case OPID_UNIT_HP:
   case OPID_UNIT_VETERAN:
@@ -3128,6 +3128,7 @@
     gtk_widget_set_sensitive(entry, pv != NULL);
     break;
 
+  case OPID_UNIT_MOVES_LEFT:
   case OPID_CITY_SIZE:
   case OPID_CITY_HISTORY:
   case OPID_CITY_SHIELD_STOCK:
@@ -3151,7 +3152,6 @@
     gtk_widget_set_sensitive(spin, pv != NULL);
     break;
 
-  case OPID_UNIT_MOVES_LEFT:
   case OPID_UNIT_FUEL:
   case OPID_UNIT_HP:
   case OPID_UNIT_VETERAN:

Modified: branches/S2_6/client/gui-gtk-3.0/editprop.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/editprop.c?rev=31080&r1=31079&r2=31080&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/editprop.c (original)
+++ branches/S2_6/client/gui-gtk-3.0/editprop.c Fri Dec 18 21:13:03 2015
@@ -1897,7 +1897,7 @@
       switch (propid) {
       case OPID_UNIT_MOVES_LEFT:
         *pmin = 0;
-        *pmax = putype->move_rate;
+        *pmax = 65535; /* packets.def MOVEFRAGS */
         *pstep = 1;
         *pbig_step = 5;
         return TRUE;
@@ -2945,6 +2945,7 @@
     objprop_set_child_widget(op, "entry", entry);
     return;
 
+  case OPID_UNIT_MOVES_LEFT:
   case OPID_CITY_SIZE:
   case OPID_CITY_HISTORY:
   case OPID_CITY_SHIELD_STOCK:
@@ -2960,7 +2961,6 @@
     objprop_set_child_widget(op, "spin", spin);
     return;
 
-  case OPID_UNIT_MOVES_LEFT:
   case OPID_UNIT_FUEL:
   case OPID_UNIT_HP:
   case OPID_UNIT_VETERAN:
@@ -3143,6 +3143,7 @@
     gtk_widget_set_sensitive(entry, pv != NULL);
     break;
 
+  case OPID_UNIT_MOVES_LEFT:
   case OPID_CITY_SIZE:
   case OPID_CITY_HISTORY:
   case OPID_CITY_SHIELD_STOCK:
@@ -3166,7 +3167,6 @@
     gtk_widget_set_sensitive(spin, pv != NULL);
     break;
 
-  case OPID_UNIT_MOVES_LEFT:
   case OPID_UNIT_FUEL:
   case OPID_UNIT_HP:
   case OPID_UNIT_VETERAN:

Modified: branches/S2_6/server/edithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/edithand.c?rev=31080&r1=31079&r2=31080&view=diff
==============================================================================
--- branches/S2_6/server/edithand.c     (original)
+++ branches/S2_6/server/edithand.c     Fri Dec 18 21:13:03 2015
@@ -769,7 +769,7 @@
   struct unit *punit;
   int id;
   bool changed = FALSE;
-  int moves_left, fuel, hp;
+  int fuel, hp;
 
   id = packet->id;
   punit = game_unit_by_number(id);
@@ -781,9 +781,8 @@
 
   putype = unit_type_get(punit);
 
-  moves_left = CLIP(0, packet->moves_left, putype->move_rate);
-  if (moves_left != punit->moves_left) {
-    punit->moves_left = moves_left;
+  if (packet->moves_left != punit->moves_left) {
+    punit->moves_left = packet->moves_left;
     changed = TRUE;
   }
 


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

Reply via email to