[Freeciv-Dev] (PR#9826) rename T_LAST as T_NONE
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9826 >
This patch renames T_LAST as T_NONE.
There are several reasons for doing this.
- All the current users don't expect T_LAST to be the last terrain.
They just use it as an arbitrary flag meaning no-terrain. They could
just as easily use T_ANY or -87.
- T_LAST isn't really the last terrain. T_COUNT tells the number of
terrains and this is not equal to T_LAST. MAX_NUM_TERRAINS gives the
maximum number of terrains: this might be better named as T_LAST, except
that again it's not equal to T_LAST. Someone might be tempted to make
an array of size T_LAST, which is probably not what they want.
- Elsewhere X_LAST is used to limit the number of items. But there's no
real reason why the number of terrains needs to be limited. If such a
thing is needed MAX_NUM_TERRAINS can be used or T_LAST can be added back in.
- The new set of special terrain values is pretty elegant: T_NONE,
T_ANY, T_UNKNOWN.
Except for the changes in terrain.h this is just search-and-replace;
however this is made hard because T_LAST is a very common string. Note
that a lot of the users have bad style. I didn't do too much to fix the
style but it should be given a quick cleanup when the patch is applied.
jason
Index: client/helpdata.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/helpdata.c,v
retrieving revision 1.71
diff -u -r1.71 helpdata.c
--- client/helpdata.c 18 Aug 2004 04:23:20 -0000 1.71
+++ client/helpdata.c 26 Aug 2004 21:33:55 -0000
@@ -113,15 +113,15 @@
tile_types[i].road_time,
tile_types[i].irrigation_time,
((tile_types[i].irrigation_result == i) ||
- (tile_types[i].irrigation_result == T_LAST)) ? "" :
+ (tile_types[i].irrigation_result == T_NONE)) ? "" :
tile_types[tile_types[i].irrigation_result].terrain_name,
tile_types[i].mining_time,
((tile_types[i].mining_result == i) ||
- (tile_types[i].mining_result == T_LAST)) ? "" :
+ (tile_types[i].mining_result == T_NONE)) ? "" :
tile_types[tile_types[i].mining_result].terrain_name,
tile_types[i].transform_time,
((tile_types[i].transform_result == i) ||
- (tile_types[i].transform_result == T_LAST)) ? "" :
+ (tile_types[i].transform_result == T_NONE)) ? "" :
tile_types[tile_types[i].transform_result].terrain_name
);
}
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.397
diff -u -r1.397 packhand.c
--- client/packhand.c 26 Aug 2004 18:37:51 -0000 1.397
+++ client/packhand.c 26 Aug 2004 21:33:56 -0000
@@ -2321,7 +2321,7 @@
} \
b->elem[p->count] = last;
- T(terr_gate, terr_gate_count, T_LAST);
+ T(terr_gate, terr_gate_count, T_NONE);
T(spec_gate, spec_gate_count, S_NO_SPECIAL);
T(equiv_dupl, equiv_dupl_count, B_LAST);
T(equiv_repl, equiv_repl_count, B_LAST);
@@ -2351,7 +2351,7 @@
"None" :
improvement_types[b->bldg_req].name);
freelog(LOG_DEBUG, " terr_gate...");
- for (inx = 0; b->terr_gate[inx] != T_LAST; inx++) {
+ for (inx = 0; b->terr_gate[inx] != T_NONE; inx++) {
freelog(LOG_DEBUG, " %2d/%s",
b->terr_gate[inx], get_terrain_name(b->terr_gate[inx]));
}
@@ -2438,7 +2438,7 @@
ptr = strchr(ptr, '\0');
my_snprintf(ptr, sizeof(buf)-(ptr-buf), " aff_terr=%d/%s",
b->effect[inx].aff_terr,
- (b->effect[inx].aff_terr == T_LAST) ?
+ (b->effect[inx].aff_terr == T_NONE) ?
"None" :
(b->effect[inx].aff_terr == T_UNKNOWN) ?
"All" :
Index: client/gui-gtk/helpdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/helpdlg.c,v
retrieving revision 1.66
diff -u -r1.66 helpdlg.c
--- client/gui-gtk/helpdlg.c 18 Aug 2004 04:23:20 -0000 1.66
+++ client/gui-gtk/helpdlg.c 26 Aug 2004 21:33:57 -0000
@@ -989,7 +989,7 @@
tile_types[i].irrigation_time);
}
}
- else if (tile_types[i].irrigation_result != T_LAST)
+ else if (tile_types[i].irrigation_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].irrigation_result].terrain_name,
@@ -1007,7 +1007,7 @@
tile_types[i].mining_time);
}
}
- else if (tile_types[i].mining_result != T_LAST)
+ else if (tile_types[i].mining_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].mining_result].terrain_name,
@@ -1015,7 +1015,7 @@
}
gtk_set_label (help_tlabel[3][1], buf);
- if (tile_types[i].transform_result != T_LAST)
+ if (tile_types[i].transform_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].transform_result].terrain_name,
Index: client/gui-gtk/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/menu.c,v
retrieving revision 1.87
diff -u -r1.87 menu.c
--- client/gui-gtk/menu.c 25 Aug 2004 18:24:19 -0000 1.87
+++ client/gui-gtk/menu.c 26 Aug 2004 21:33:58 -0000
@@ -1219,7 +1219,8 @@
ttype = map_get_tile(punit->x, punit->y)->terrain;
tinfo = get_tile_type(ttype);
- if ((tinfo->irrigation_result != T_LAST) && (tinfo->irrigation_result !=
ttype))
+ if ((tinfo->irrigation_result != T_NONE)
+ && (tinfo->irrigation_result != ttype))
{
my_snprintf (irrtext, sizeof(irrtext), irrfmt,
(get_tile_type(tinfo->irrigation_result))->terrain_name);
@@ -1229,12 +1230,14 @@
{
sz_strlcpy (irrtext, _("Bu_ild Farmland"));
}
- if ((tinfo->mining_result != T_LAST) && (tinfo->mining_result != ttype))
+ if ((tinfo->mining_result != T_NONE)
+ && (tinfo->mining_result != ttype))
{
my_snprintf (mintext, sizeof(mintext), minfmt,
(get_tile_type(tinfo->mining_result))->terrain_name);
}
- if ((tinfo->transform_result != T_LAST) && (tinfo->transform_result !=
ttype))
+ if ((tinfo->transform_result != T_NONE)
+ && (tinfo->transform_result != ttype))
{
my_snprintf (transtext, sizeof(transtext), transfmt,
(get_tile_type(tinfo->transform_result))->terrain_name);
Index: client/gui-gtk-2.0/helpdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/helpdlg.c,v
retrieving revision 1.33
diff -u -r1.33 helpdlg.c
--- client/gui-gtk-2.0/helpdlg.c 18 Aug 2004 04:23:20 -0000 1.33
+++ client/gui-gtk-2.0/helpdlg.c 26 Aug 2004 21:33:58 -0000
@@ -1055,7 +1055,7 @@
tile_types[i].irrigation_time);
}
}
- else if (tile_types[i].irrigation_result != T_LAST)
+ else if (tile_types[i].irrigation_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].irrigation_result].terrain_name,
@@ -1073,7 +1073,7 @@
tile_types[i].mining_time);
}
}
- else if (tile_types[i].mining_result != T_LAST)
+ else if (tile_types[i].mining_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].mining_result].terrain_name,
@@ -1081,7 +1081,7 @@
}
gtk_label_set_text(GTK_LABEL(help_tlabel[3][1]), buf);
- if (tile_types[i].transform_result != T_LAST)
+ if (tile_types[i].transform_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].transform_result].terrain_name,
Index: client/gui-gtk-2.0/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/menu.c,v
retrieving revision 1.36
diff -u -r1.36 menu.c
--- client/gui-gtk-2.0/menu.c 25 Aug 2004 18:24:19 -0000 1.36
+++ client/gui-gtk-2.0/menu.c 26 Aug 2004 21:33:58 -0000
@@ -1295,7 +1295,7 @@
ttype = map_get_tile(punit->x, punit->y)->terrain;
tinfo = get_tile_type(ttype);
- if ((tinfo->irrigation_result != T_LAST) && (tinfo->irrigation_result !=
ttype))
+ if ((tinfo->irrigation_result != T_NONE) && (tinfo->irrigation_result !=
ttype))
{
my_snprintf (irrtext, sizeof(irrtext), irrfmt,
(get_tile_type(tinfo->irrigation_result))->terrain_name);
@@ -1305,12 +1305,12 @@
{
sz_strlcpy (irrtext, _("Bu_ild Farmland"));
}
- if ((tinfo->mining_result != T_LAST) && (tinfo->mining_result != ttype))
+ if ((tinfo->mining_result != T_NONE) && (tinfo->mining_result != ttype))
{
my_snprintf (mintext, sizeof(mintext), minfmt,
(get_tile_type(tinfo->mining_result))->terrain_name);
}
- if ((tinfo->transform_result != T_LAST) && (tinfo->transform_result !=
ttype))
+ if ((tinfo->transform_result != T_NONE) && (tinfo->transform_result !=
ttype))
{
my_snprintf (transtext, sizeof(transtext), transfmt,
(get_tile_type(tinfo->transform_result))->terrain_name);
Index: client/gui-mui/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/gui_main.c,v
retrieving revision 1.84
diff -u -r1.84 gui_main.c
--- client/gui-mui/gui_main.c 25 Aug 2004 18:24:19 -0000 1.84
+++ client/gui-mui/gui_main.c 26 Aug 2004 21:33:59 -0000
@@ -1282,7 +1282,7 @@
ttype = map_get_tile(punit->x, punit->y)->terrain;
tinfo = get_tile_type(ttype);
- if ((tinfo->irrigation_result != T_LAST) && (tinfo->irrigation_result !=
ttype))
+ if ((tinfo->irrigation_result != T_NONE) && (tinfo->irrigation_result !=
ttype))
{
my_snprintf(irrtext, sizeof(irrtext), chgfmt,
(get_tile_type(tinfo->irrigation_result))->terrain_name);
}
@@ -1296,7 +1296,7 @@
sz_strlcpy(irrtext, _("Build Irrigation"));
}
- if ((tinfo->mining_result != T_LAST) && (tinfo->mining_result != ttype))
+ if ((tinfo->mining_result != T_NONE) && (tinfo->mining_result != ttype))
{
my_snprintf(mintext, sizeof(mintext), chgfmt,
(get_tile_type(tinfo->mining_result))->terrain_name);
}
@@ -1305,7 +1305,7 @@
sz_strlcpy(mintext, _("Build Mine"));
}
- if ((tinfo->transform_result != T_LAST) && (tinfo->transform_result !=
ttype))
+ if ((tinfo->transform_result != T_NONE) && (tinfo->transform_result !=
ttype))
{
my_snprintf(transtext, sizeof(transtext), chgfmt,
(get_tile_type(tinfo->transform_result))->terrain_name);
}
Index: client/gui-win32/helpdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/helpdlg.c,v
retrieving revision 1.19
diff -u -r1.19 helpdlg.c
--- client/gui-win32/helpdlg.c 18 Aug 2004 04:23:20 -0000 1.19
+++ client/gui-win32/helpdlg.c 26 Aug 2004 21:33:59 -0000
@@ -616,7 +616,7 @@
tile_types[i].irrigation_time);
}
}
- else if (tile_types[i].irrigation_result != T_LAST)
+ else if (tile_types[i].irrigation_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].irrigation_result].terrain_name,
@@ -634,7 +634,7 @@
tile_types[i].mining_time);
}
}
- else if (tile_types[i].mining_result != T_LAST)
+ else if (tile_types[i].mining_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].mining_result].terrain_name,
@@ -642,7 +642,7 @@
}
SetWindowText (help_tlabel[3][1], buf);
- if (tile_types[i].transform_result != T_LAST)
+ if (tile_types[i].transform_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].transform_result].terrain_name,
Index: client/gui-win32/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/menu.c,v
retrieving revision 1.22
diff -u -r1.22 menu.c
--- client/gui-win32/menu.c 25 Aug 2004 18:24:19 -0000 1.22
+++ client/gui-win32/menu.c 26 Aug 2004 21:33:59 -0000
@@ -976,7 +976,7 @@
}
ttype = map_get_tile(punit->x, punit->y)->terrain;
tinfo = get_tile_type(ttype);
- if ((tinfo->irrigation_result != T_LAST) && (tinfo->irrigation_result
!= ttype))
+ if ((tinfo->irrigation_result != T_NONE) && (tinfo->irrigation_result
!= ttype))
{
my_snprintf (irrtext, sizeof(irrtext), chgfmt,
(get_tile_type(tinfo->irrigation_result))->terrain_name);
@@ -986,12 +986,12 @@
{
sz_strlcpy (irrtext, _("Build Farmland"));
}
- if ((tinfo->mining_result != T_LAST) && (tinfo->mining_result != ttype))
+ if ((tinfo->mining_result != T_NONE) && (tinfo->mining_result != ttype))
{
my_snprintf (mintext, sizeof(mintext), chgfmt,
(get_tile_type(tinfo->mining_result))->terrain_name);
}
- if ((tinfo->transform_result != T_LAST) && (tinfo->transform_result !=
ttype))
+ if ((tinfo->transform_result != T_NONE) && (tinfo->transform_result !=
ttype))
{
my_snprintf (transtext, sizeof(transtext), transfmt,
(get_tile_type(tinfo->transform_result))->terrain_name);
Index: client/gui-xaw/helpdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/helpdlg.c,v
retrieving revision 1.50
diff -u -r1.50 helpdlg.c
--- client/gui-xaw/helpdlg.c 18 Aug 2004 04:23:20 -0000 1.50
+++ client/gui-xaw/helpdlg.c 26 Aug 2004 21:34:00 -0000
@@ -1043,7 +1043,7 @@
tile_types[i].irrigation_time);
}
}
- else if (tile_types[i].irrigation_result != T_LAST)
+ else if (tile_types[i].irrigation_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].irrigation_result].terrain_name,
@@ -1061,7 +1061,7 @@
tile_types[i].mining_time);
}
}
- else if (tile_types[i].mining_result != T_LAST)
+ else if (tile_types[i].mining_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].mining_result].terrain_name,
@@ -1069,7 +1069,7 @@
}
xaw_set_label (help_terrain_mining_result_time_data, buf);
- if (tile_types[i].transform_result != T_LAST)
+ if (tile_types[i].transform_result != T_NONE)
{
sprintf (buf, "%s / %d",
tile_types[tile_types[i].transform_result].terrain_name,
Index: client/gui-xaw/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.c,v
retrieving revision 1.67
diff -u -r1.67 menu.c
--- client/gui-xaw/menu.c 25 Aug 2004 18:24:19 -0000 1.67
+++ client/gui-xaw/menu.c 26 Aug 2004 21:34:00 -0000
@@ -444,7 +444,8 @@
TEXT_ORDER_CITY_BUILD, NULL);
}
- if ((tinfo->irrigation_result != T_LAST) && (tinfo->irrigation_result !=
ttype)) {
+ if ((tinfo->irrigation_result != T_NONE)
+ && (tinfo->irrigation_result != ttype)) {
menu_entry_rename(MENU_ORDER, MENU_ORDER_IRRIGATE,
TEXT_ORDER_IRRIGATE_CHANGE_TO,
(get_tile_type(tinfo->irrigation_result))->terrain_name);
@@ -458,7 +459,8 @@
TEXT_ORDER_IRRIGATE_IRRIGATE, NULL);
}
- if ((tinfo->mining_result != T_LAST) && (tinfo->mining_result != ttype))
{
+ if ((tinfo->mining_result != T_NONE)
+ && (tinfo->mining_result != ttype)) {
menu_entry_rename(MENU_ORDER, MENU_ORDER_MINE,
TEXT_ORDER_MINE_CHANGE_TO,
(get_tile_type(tinfo->mining_result))->terrain_name);
@@ -467,7 +469,8 @@
TEXT_ORDER_MINE_MINE, NULL);
}
- if ((tinfo->transform_result != T_LAST) && (tinfo->transform_result !=
ttype)) {
+ if ((tinfo->transform_result != T_NONE)
+ && (tinfo->transform_result != ttype)) {
menu_entry_rename(MENU_ORDER, MENU_ORDER_TRANSFORM,
TEXT_ORDER_TRANSFORM_TRANSFORM_TO,
(get_tile_type(tinfo->transform_result))->terrain_name);
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.237
diff -u -r1.237 city.c
--- common/city.c 25 Aug 2004 18:24:19 -0000 1.237
+++ common/city.c 26 Aug 2004 21:34:01 -0000
@@ -377,14 +377,16 @@
spec_gate = impr->spec_gate;
terr_gate = impr->terr_gate;
- if (*spec_gate==S_NO_SPECIAL && *terr_gate==T_LAST) return TRUE;
+ if (*spec_gate == S_NO_SPECIAL && *terr_gate == T_NONE) {
+ return TRUE;
+ }
for (;*spec_gate!=S_NO_SPECIAL;spec_gate++) {
if (map_has_special(pcity->x, pcity->y, *spec_gate) ||
is_special_near_tile(pcity->x,pcity->y,*spec_gate)) return TRUE;
}
- for (;*terr_gate!=T_LAST;terr_gate++) {
+ for (; *terr_gate != T_NONE; terr_gate++) {
if (map_get_terrain(pcity->x,pcity->y) == *terr_gate ||
is_terrain_near_tile(pcity->x,pcity->y,*terr_gate)) return TRUE;
}
Index: common/improvement.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/improvement.h,v
retrieving revision 1.29
diff -u -r1.29 improvement.h
--- common/improvement.h 25 Aug 2004 18:24:19 -0000 1.29
+++ common/improvement.h 26 Aug 2004 21:34:01 -0000
@@ -89,7 +89,7 @@
Tech_Type_id cond_adv; /* A_NONE = unconditional; A_LAST = never */
enum effect_type cond_eff; /* EFT_LAST = unconditional */
Unit_Class_id aff_unit; /* UCL_LAST = all */
- Terrain_type_id aff_terr; /* T_UNKNOWN = all; T_LAST = none */
+ Terrain_type_id aff_terr; /* T_UNKNOWN = all; T_NONE = none */
enum tile_special_type aff_spec; /* S_* bit mask of specials affected */
};
@@ -105,7 +105,7 @@
char graphic_alt[MAX_LEN_NAME]; /* city icon of improv. */
Tech_Type_id tech_req; /* A_LAST = never; A_NONE = always */
Impr_Type_id bldg_req; /* B_LAST = none required */
- Terrain_type_id *terr_gate; /* list; T_LAST terminated */
+ Terrain_type_id *terr_gate; /* list; T_NONE terminated */
enum tile_special_type *spec_gate; /* list; S_NO_SPECIAL terminated */
enum impr_range equiv_range;
Impr_Type_id *equiv_dupl; /* list; B_LAST terminated */
Index: common/map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.188
diff -u -r1.188 map.c
--- common/map.c 25 Aug 2004 18:24:19 -0000 1.188
+++ common/map.c 26 Aug 2004 21:34:02 -0000
@@ -926,8 +926,7 @@
} else {
map_set_special(x, y, S_IRRIGATION);
}
- }
- else if (result != T_LAST) {
+ } else if (result != T_NONE) {
map_set_terrain(x, y, result);
if (is_ocean(result)) {
clear_infrastructure(x, y);
@@ -952,7 +951,7 @@
if (now == result)
map_set_special(x, y, S_MINE);
- else if (result != T_LAST) {
+ else if (result != T_NONE) {
map_set_terrain(x, y, result);
if (is_ocean(result)) {
clear_infrastructure(x, y);
@@ -1003,8 +1002,9 @@
now = map_get_terrain(x, y);
result = tile_types[now].transform_result;
- if (result != T_LAST)
+ if (result != T_NONE) {
change_terrain(x, y, result);
+ }
}
/**************************************************************************
Index: common/terrain.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/terrain.c,v
retrieving revision 1.11
diff -u -r1.11 terrain.c
--- common/terrain.c 25 Aug 2004 18:57:07 -0000 1.11
+++ common/terrain.c 26 Aug 2004 21:34:02 -0000
@@ -114,7 +114,7 @@
} terrain_type_iterate_end;
die("Reached end of get_flag_terrain!");
- return T_LAST;
+ return T_NONE;
}
/****************************************************************************
Index: common/terrain.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/terrain.h,v
retrieving revision 1.20
diff -u -r1.20 terrain.h
--- common/terrain.h 25 Aug 2004 18:57:07 -0000 1.20
+++ common/terrain.h 26 Aug 2004 21:34:02 -0000
@@ -65,8 +65,9 @@
/* Changing this breaks savegame and network compatability. */
enum tile_terrain_type {
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_UNKNOWN,
- T_LAST, /* last terrain type */
+ T_MOUNTAINS, T_OCEAN, T_PLAINS, T_UNUSED, T_SWAMP, T_TUNDRA,
+ T_UNKNOWN, /* A special flag meaning unknown terrain. */
+ T_NONE, /* A special flag meaning no terrain. */
T_ANY /* A special flag that matches "any" terrain type. */
};
Index: common/unit.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/unit.c,v
retrieving revision 1.215
diff -u -r1.215 unit.c
--- common/unit.c 17 Aug 2004 05:13:58 -0000 1.215
+++ common/unit.c 26 Aug 2004 21:34:03 -0000
@@ -865,7 +865,7 @@
&& ((ptile->terrain == type->mining_result
&& !tile_has_special(ptile, S_MINE))
|| (ptile->terrain != type->mining_result
- && type->mining_result != T_LAST
+ && type->mining_result != T_NONE
&& (!is_ocean(ptile->terrain)
|| is_ocean(type->mining_result)
|| can_reclaim_ocean(map_x, map_y))
@@ -895,7 +895,7 @@
&& ((ptile->terrain == type->irrigation_result
&& is_water_adjacent_to_tile(map_x, map_y))
|| (ptile->terrain != type->irrigation_result
- && type->irrigation_result != T_LAST
+ && type->irrigation_result != T_NONE
&& (!is_ocean(ptile->terrain)
|| is_ocean(type->irrigation_result)
|| can_reclaim_ocean(map_x, map_y))
@@ -981,7 +981,7 @@
case ACTIVITY_TRANSFORM:
return (terrain_control.may_transform
- && type->transform_result != T_LAST
+ && type->transform_result != T_NONE
&& ptile->terrain != type->transform_result
&& (!is_ocean(ptile->terrain)
|| is_ocean(type->transform_result)
Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.270
diff -u -r1.270 citytools.c
--- server/citytools.c 25 Aug 2004 18:24:20 -0000 1.270
+++ server/citytools.c 26 Aug 2004 21:34:04 -0000
@@ -2070,7 +2070,7 @@
}
while (!is_ocean(improvement_types[impr].terr_gate[i])
- && improvement_types[impr].terr_gate[i] != T_LAST) {
+ && improvement_types[impr].terr_gate[i] != T_NONE) {
i++;
}
Index: server/maphand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/maphand.c,v
retrieving revision 1.144
diff -u -r1.144 maphand.c
--- server/maphand.c 25 Aug 2004 18:24:20 -0000 1.144
+++ server/maphand.c 26 Aug 2004 21:34:04 -0000
@@ -143,7 +143,7 @@
} else {
new = get_tile_type(old)->warmer_drier_result;
}
- if (new != T_LAST && old != new) {
+ if (new != T_NONE && old != new) {
effect--;
change_terrain(x, y, new);
send_tile_info(NULL, x, y);
@@ -184,7 +184,7 @@
} else {
new = get_tile_type(old)->cooler_drier_result;
}
- if (new != T_LAST && old != new) {
+ if (new != T_NONE && old != new) {
effect--;
change_terrain(x, y, new);
send_tile_info(NULL, x, y);
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.190
diff -u -r1.190 ruleset.c
--- server/ruleset.c 25 Aug 2004 18:57:07 -0000 1.190
+++ server/ruleset.c 26 Aug 2004 21:34:06 -0000
@@ -485,7 +485,7 @@
if (*name == '\0' || (0 == strcmp(name, "none"))
|| (0 == strcmp(name, "no"))) {
- return (T_LAST);
+ return T_NONE;
} else if (0 == strcmp(name, "yes")) {
return (tthis);
}
@@ -499,7 +499,7 @@
/* TRANS: message for an obscure ruleset error. */
freelog(LOG_ERROR, _("Unknown terrain %s in entry %s."),
name, tile_types[tthis].terrain_name);
- return T_LAST;
+ return T_NONE;
}
/**************************************************************************
@@ -1191,7 +1191,7 @@
k++;
}
}
- b->terr_gate[k] = T_LAST;
+ b->terr_gate[k] = T_NONE;
free(list);
list = secfile_lookup_str_vec(file, &count, "%s.spec_gate", sec[i]);
@@ -1391,14 +1391,14 @@
secfile_lookup_str_default(file, "", "%s.effect%d.aff_terr", sec[i], j);
if (*item != '\0') {
if (0 == strcmp("None", item)) {
- e->aff_terr = T_LAST;
+ e->aff_terr = T_NONE;
} else {
e->aff_terr = get_terrain_by_name(item);
if (e->aff_terr == T_UNKNOWN) {
freelog(LOG_ERROR,
"for %s effect[%d].aff_terr couldn't match terrain \"%s\"
(%s)",
b->name, j, item, filename);
- e->aff_terr = T_LAST;
+ e->aff_terr = T_NONE;
problem = TRUE;
}
}
@@ -2898,7 +2898,7 @@
packet.elem[packet.count] = b->elem[packet.count]; \
}
- T(terr_gate, terr_gate_count, T_LAST);
+ T(terr_gate, terr_gate_count, T_NONE);
T(spec_gate, spec_gate_count, S_NO_SPECIAL);
T(equiv_dupl, equiv_dupl_count, B_LAST);
T(equiv_repl, equiv_repl_count, B_LAST);
Index: server/settlers.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v
retrieving revision 1.197
diff -u -r1.197 settlers.c
--- server/settlers.c 25 Aug 2004 18:24:21 -0000 1.197
+++ server/settlers.c 26 Aug 2004 21:34:07 -0000
@@ -394,7 +394,7 @@
struct tile_type *type = get_tile_type(old_terrain);
Terrain_type_id new_terrain = type->irrigation_result;
- if (old_terrain != new_terrain && new_terrain != T_LAST) {
+ if (old_terrain != new_terrain && new_terrain != T_NONE) {
/* Irrigation would change the terrain type, clearing the mine
* in the process. Calculate the benefit of doing so. */
if (ptile->city && terrain_has_flag(new_terrain, TER_NO_CITIES)) {
@@ -458,7 +458,7 @@
struct tile_type *type = get_tile_type(old_terrain);
Terrain_type_id new_terrain = type->mining_result;
- if (old_terrain != new_terrain && new_terrain != T_LAST) {
+ if (old_terrain != new_terrain && new_terrain != T_NONE) {
/* Mining would change the terrain type, clearing the irrigation
* in the process. Calculate the benefit of doing so. */
if (ptile->city && terrain_has_flag(new_terrain, TER_NO_CITIES)) {
@@ -511,7 +511,7 @@
struct tile_type *type = get_tile_type(old_terrain);
Terrain_type_id new_terrain = type->transform_result;
- if (old_terrain == new_terrain || new_terrain == T_LAST) {
+ if (old_terrain == new_terrain || new_terrain == T_NONE) {
return -1;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#9826) rename T_LAST as T_NONE,
Jason Short <=
|
|