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

 This restores free unit upkeep functionality.


 - ML

diff -Nurd -X.diff_ignore freeciv/common/city.c freeciv/common/city.c
--- freeciv/common/city.c       2008-08-03 19:54:51.000000000 +0300
+++ freeciv/common/city.c       2008-08-08 01:29:26.000000000 +0300
@@ -2163,9 +2163,6 @@
   assert(punit != NULL && pcity != NULL && ut != NULL 
          && free_upkeep != NULL && outputs != NULL);
   memset(outputs, 0, O_COUNT * sizeof(*outputs));
-  output_type_iterate(o) {
-    outputs[o] = utype_upkeep_cost(ut, plr, o);
-  } output_type_iterate_end;
 
   /* set current upkeep on unit to zero */
 
@@ -2174,7 +2171,10 @@
     if (cost > 0) {
       if (free_upkeep[o] > cost) {
         free_upkeep[o] -= cost;
-        continue;
+        cost = 0;
+      } else {
+        cost -= free_upkeep[o];
+        free_upkeep[o] = 0;
       }
       outputs[o] = cost;
     }
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to