Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#9909) remove T_UNUSED
Home

[Freeciv-Dev] (PR#9909) remove T_UNUSED

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9909) remove T_UNUSED
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Sep 2004 11:54:00 -0700
Reply-to: rt@xxxxxxxxxxx

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

This patch removes T_UNUSED from the terrain enumeration and the rulesets.

The only reason not to do this is that this provides an extra terrain 
that rulesets can modify without breaking the code.  However my next 
patch should make T_COUNT a variable so that won't be a problem - new 
terrains can be added at the end (although mapgen won't support them).

Note that a terrain may still be "unused" if it's name is set to "" or 
"unused".  Mapgen won't respect this but other parts of the code 
generally will.  I don't want to add a terrain_exists() function.  In 
the long term there should be no unused terrains in the ruleset.

jason

Index: common/terrain.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/terrain.h,v
retrieving revision 1.23
diff -u -r1.23 terrain.h
--- common/terrain.h    2 Sep 2004 18:36:14 -0000       1.23
+++ common/terrain.h    2 Sep 2004 18:51:16 -0000
@@ -68,7 +68,7 @@
   T_ANY = -2, /* A special flag that matches "any" terrain type. */
   T_UNKNOWN = -1, /* A special flag meaning unknown terrain. */
   T_ARCTIC, T_DESERT, T_FOREST, T_GRASSLAND, T_HILLS, T_JUNGLE, 
-  T_MOUNTAINS, T_OCEAN, T_PLAINS, T_UNUSED, T_SWAMP, T_TUNDRA
+  T_MOUNTAINS, T_OCEAN, T_PLAINS, T_SWAMP, T_TUNDRA
 };
 
 /* The first terrain value and number of base terrains.  This is used in
Index: data/civ1/terrain.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/civ1/terrain.ruleset,v
retrieving revision 1.27
diff -u -r1.27 terrain.ruleset
--- data/civ1/terrain.ruleset   24 Aug 2004 01:59:43 -0000      1.27
+++ data/civ1/terrain.ruleset   2 Sep 2004 18:51:16 -0000
@@ -539,44 +539,6 @@
  inconvenient.\
 ")
 
-[terrain_unused_0]
-terrain_name         = "unused"
-graphic              = "-"
-graphic_alt         = "-"
-identifier          = "r"
-movement_cost        = 0
-defense_bonus        = 00
-food                 = 0
-shield               = 0
-trade                = 0
-special_1_name       = "none"
-graphic_special_1    = "-"
-graphic_special_1a   = "-"
-food_special_1       = 0
-shield_special_1     = 0
-trade_special_1      = 0
-special_2_name       = "none"
-graphic_special_2    = "-"
-graphic_special_2a   = "-"
-food_special_2       = 0
-shield_special_2     = 0
-trade_special_2      = 0
-road_trade_incr      = 0
-road_time            = 2
-irrigation_result    = "no"
-irrigation_food_incr = 0
-irrigation_time      = 0
-mining_result        = "no"
-mining_shield_incr   = 0
-mining_time          = 0
-transform_result     = "no"
-transform_time       = 0
-warmer_wetter_result = "no"
-warmer_drier_result  = "no"
-cooler_wetter_result = "no"
-cooler_drier_result  = "no"
-helptext            = ""
-
 [terrain_swamp]
 terrain_name         = _("Swamp")
 graphic              = "swamp"
Index: data/civ2/terrain.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/civ2/terrain.ruleset,v
retrieving revision 1.29
diff -u -r1.29 terrain.ruleset
--- data/civ2/terrain.ruleset   24 Aug 2004 01:59:43 -0000      1.29
+++ data/civ2/terrain.ruleset   2 Sep 2004 18:51:16 -0000
@@ -553,43 +553,6 @@
  inconvenient.\
 ")
 
-[terrain_unused_0]
-terrain_name         = "unused"
-graphic              = "-"
-graphic_alt         = "-"
-identifier          = "r"
-movement_cost        = 0
-defense_bonus        = 00
-food                 = 0
-shield               = 0
-trade                = 0
-special_1_name       = "none"
-graphic_special_1    = "-"
-graphic_special_1a   = "-"
-food_special_1       = 0
-shield_special_1     = 0
-trade_special_1      = 0
-special_2_name       = "none"
-graphic_special_2    = "-"
-graphic_special_2a   = "-"
-food_special_2       = 0
-shield_special_2     = 0
-trade_special_2      = 0
-road_trade_incr      = 0
-road_time            = 0
-irrigation_result    = "no"
-irrigation_food_incr = 0
-irrigation_time      = 0
-mining_result        = "no"
-mining_shield_incr   = 0
-mining_time          = 0
-transform_result     = "no"
-transform_time       = 0
-warmer_wetter_result = "no"
-warmer_drier_result  = "no"
-cooler_wetter_result = "no"
-cooler_drier_result  = "no"
-
 [terrain_swamp]
 terrain_name         = _("Swamp")
 graphic              = "swamp"
Index: data/default/terrain.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/terrain.ruleset,v
retrieving revision 1.30
diff -u -r1.30 terrain.ruleset
--- data/default/terrain.ruleset        24 Aug 2004 01:59:43 -0000      1.30
+++ data/default/terrain.ruleset        2 Sep 2004 18:51:16 -0000
@@ -600,48 +600,6 @@
  inconvenient.\
 ")
 
-[terrain_unused_0]
-terrain_name         = "unused"
-graphic              = "-"
-graphic_alt         = "-"
-identifier          = "r"
-movement_cost        = 0
-defense_bonus        = 00
-food                 = 0
-shield               = 0
-trade                = 0
-special_1_name       = "none"
-graphic_special_1    = "-"
-graphic_special_1a   = "-"
-food_special_1       = 0
-shield_special_1     = 0
-trade_special_1      = 0
-special_2_name       = "none"
-graphic_special_2    = "-"
-graphic_special_2a   = "-"
-food_special_2       = 0
-shield_special_2     = 0
-trade_special_2      = 0
-road_trade_incr      = 0
-road_time            = 0
-irrigation_result    = "no"
-irrigation_food_incr = 0
-irrigation_time      = 0
-mining_result        = "no"
-mining_shield_incr   = 0
-mining_time          = 0
-transform_result     = "no"
-transform_time       = 0
-rail_time            = 0
-airbase_time         = 0
-fortress_time        = 0
-clean_pollution_time = 0
-clean_fallout_time   = 0
-warmer_wetter_result = "no"
-warmer_drier_result  = "no"
-cooler_wetter_result = "no"
-cooler_drier_result  = "no"
-
 [terrain_swamp]
 terrain_name         = _("Swamp")
 graphic              = "swamp"
Index: data/history/terrain.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/history/terrain.ruleset,v
retrieving revision 1.12
diff -u -r1.12 terrain.ruleset
--- data/history/terrain.ruleset        24 Aug 2004 01:59:43 -0000      1.12
+++ data/history/terrain.ruleset        2 Sep 2004 18:51:17 -0000
@@ -597,48 +597,6 @@
  inconvenient.\
 ")
 
-[terrain_unused_0]
-terrain_name         = "unused"
-graphic              = "-"
-graphic_alt         = "-"
-identifier          = "r"
-movement_cost        = 0
-defense_bonus        = 00
-food                 = 0
-shield               = 0
-trade                = 0
-special_1_name       = "none"
-graphic_special_1    = "-"
-graphic_special_1a   = "-"
-food_special_1       = 0
-shield_special_1     = 0
-trade_special_1      = 0
-special_2_name       = "none"
-graphic_special_2    = "-"
-graphic_special_2a   = "-"
-food_special_2       = 0
-shield_special_2     = 0
-trade_special_2      = 0
-road_trade_incr      = 0
-road_time            = 0
-irrigation_result    = "no"
-irrigation_food_incr = 0
-irrigation_time      = 0
-mining_result        = "no"
-mining_shield_incr   = 0
-mining_time          = 0
-transform_result     = "no"
-transform_time       = 0
-rail_time            = 0
-airbase_time         = 0
-fortress_time        = 0
-clean_pollution_time = 0
-clean_fallout_time   = 0
-warmer_wetter_result = "no"
-warmer_drier_result  = "no"
-cooler_wetter_result = "no"
-cooler_drier_result  = "no"
-
 [terrain_swamp]
 terrain_name         = _("Swamp")
 graphic              = "swamp"

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9909) remove T_UNUSED, Jason Short <=