Complete.Org: Mailing Lists: Archives: freeciv-dev: June 1999:
[Freeciv-Dev] PATCH: minor change to city_buy_cost().
Home

[Freeciv-Dev] PATCH: minor change to city_buy_cost().

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxxx
Subject: [Freeciv-Dev] PATCH: minor change to city_buy_cost().
From: Tony Stuckey <stuckey@xxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jun 1999 16:55:37 -0500

        Moving repeated code to a common area.

Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.43
diff -u -r1.43 city.c
--- city.c      1999/06/12 07:41:55     1.43
+++ city.c      1999/06/21 21:38:59
@@ -747,23 +747,22 @@
 {
   int total,cost;
   int build=pcity->shield_stock;
+
   if (pcity->is_building_unit) {
     total=unit_value(pcity->currently_building);
     if (build>=total)
       return 0;
     cost=(total-build)*2+(total-build)*(total-build)/20; 
-    if (!build)
-      cost*=2;
   } else {
     total=improvement_value(pcity->currently_building);
     if (build>=total)
       return 0;
     cost=(total-build)*2;
-    if(!build)
-      cost*=2;
     if(is_wonder(pcity->currently_building))
       cost*=2;
   }
+  if(!build)
+    cost*=2;
   return cost;
 }

-- 
Anthony J. Stuckey                              stuckey@xxxxxxxxxxxxxxxxx
"When I was young, the sky was filled with stars.
 I watched them burn out one by one."  -Warren Zevon

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] PATCH: minor change to city_buy_cost()., Tony Stuckey <=