Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] Re: (PR#10368) RfP: #define ACTIVITY_FACTOR
Home

[Freeciv-Dev] Re: (PR#10368) RfP: #define ACTIVITY_FACTOR

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10368) RfP: #define ACTIVITY_FACTOR
From: "Marek \"Baczek\" Baczyński" <imbaczek@xxxxxxxxx>
Date: Tue, 28 Sep 2004 03:52:00 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10368 >

On Mon, 27 Sep 2004 19:26:31 -0700, Jason Short
<jdorje@xxxxxxxxxxxxxxxxxxxxx> wrote:

> In map.c in map_activity_time() there is a constant value 10.  It is
> also used by almost all callers.  It should be changed to a #define
> ACTIVITY_FACTOR in map.h.
> 
> Patch wanted.

Changed all 10s to ACTIVITY_FACTOR.

-- 
{ Marek Baczyński :: UIN 57114871 :: GG 161671 :: JID imbaczek@xxxxxxxxxxxxx  }
{ http://www.vlo.ids.gda.pl/ | imbaczek at poczta fm | http://www.promode.org }
.. .. .. .. ... ... ...... evolve or face extinction ...... ... ... .. .. .. ..

Index: map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.197
diff -u -r1.197 map.c
--- map.c       20 Sep 2004 16:42:30 -0000      1.197
+++ map.c       28 Sep 2004 10:48:07 -0000
@@ -765,7 +765,7 @@
 ***************************************************************/
 int map_build_road_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].road_time * 10;
+  return tile_types[map_get_terrain(x, y)].road_time * ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -773,7 +773,7 @@
 ***************************************************************/
 int map_build_irrigation_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].irrigation_time * 10;
+  return tile_types[map_get_terrain(x, y)].irrigation_time * ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -781,7 +781,7 @@
 ***************************************************************/
 int map_build_mine_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].mining_time * 10;
+  return tile_types[map_get_terrain(x, y)].mining_time * ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -789,7 +789,7 @@
 ***************************************************************/
 int map_transform_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].transform_time * 10;
+  return tile_types[map_get_terrain(x, y)].transform_time * ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -797,7 +797,7 @@
 ***************************************************************/
 int map_build_rail_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].rail_time * 10;
+  return tile_types[map_get_terrain(x, y)].rail_time * ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -805,7 +805,7 @@
 ***************************************************************/
 int map_build_airbase_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].airbase_time * 10;
+  return tile_types[map_get_terrain(x, y)].airbase_time * ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -813,7 +813,7 @@
 ***************************************************************/
 int map_build_fortress_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].fortress_time * 10;
+  return tile_types[map_get_terrain(x, y)].fortress_time * ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -821,7 +821,7 @@
 ***************************************************************/
 int map_clean_pollution_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].clean_pollution_time * 10;
+  return tile_types[map_get_terrain(x, y)].clean_pollution_time * 
ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -829,7 +829,7 @@
 ***************************************************************/
 int map_clean_fallout_time(int x, int y)
 {
-  return tile_types[map_get_terrain(x, y)].clean_fallout_time * 10;
+  return tile_types[map_get_terrain(x, y)].clean_fallout_time * 
ACTIVITY_FACTOR;
 }
 
 /***************************************************************
@@ -1534,7 +1534,7 @@
                           bool (*filter)(int x, int y, void *data))
 {
   int tries = 0;
-  const int max_tries = map.xsize * map.ysize / 10;
+  const int max_tries = map.xsize * map.ysize / ACTIVITY_FACTOR;
 
   /* First do a few quick checks to find a spot.  The limit on number of
    * tries could use some tweaking. */
Index: map.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.h,v
retrieving revision 1.217
diff -u -r1.217 map.h
--- map.h       20 Sep 2004 16:42:30 -0000      1.217
+++ map.h       28 Sep 2004 10:48:09 -0000
@@ -701,4 +701,6 @@
   } do_in_native_pos_end;
 }
 
+#define ACTIVITY_FACTOR         10
+
 #endif  /* FC__MAP_H */

[Prev in Thread] Current Thread [Next in Thread]