(svn r13368) -Codechange: give house's min/max_date a better name, as it is really year, not date
authorbelugas
Tue, 03 Jun 2008 03:06:16 +0000
changeset 9450 9e7d05b0b1e5
parent 9449 240fedf4ed2c
child 9451 0d6806ba5504
(svn r13368) -Codechange: give house's min/max_date a better name, as it is really year, not date
src/newgrf.cpp
src/table/town_land.h
src/town.h
src/town_cmd.cpp
--- a/src/newgrf.cpp	Tue Jun 03 02:20:27 2008 +0000
+++ b/src/newgrf.cpp	Tue Jun 03 03:06:16 2008 +0000
@@ -1404,7 +1404,7 @@
 				 * date before 1930, as this breaks the build date stuff.
 				 * @see FinaliseHouseArray() for more details.
 				 */
-				if (housespec->min_date < 1930) housespec->min_date = 1930;
+				if (housespec->min_year < 1930) housespec->min_year = 1930;
 
 				_loaded_newgrf_features.has_newhouses = true;
 			} break;
@@ -1415,8 +1415,8 @@
 
 			case 0x0A: { // Availability years
 				uint16 years = grf_load_word(&buf);
-				housespec->min_date = GB(years, 0, 8) > 150 ? MAX_YEAR : ORIGINAL_BASE_YEAR + GB(years, 0, 8);
-				housespec->max_date = GB(years, 8, 8) > 150 ? MAX_YEAR : ORIGINAL_BASE_YEAR + GB(years, 8, 8);
+				housespec->min_year = GB(years, 0, 8) > 150 ? MAX_YEAR : ORIGINAL_BASE_YEAR + GB(years, 0, 8);
+				housespec->max_year = GB(years, 8, 8) > 150 ? MAX_YEAR : ORIGINAL_BASE_YEAR + GB(years, 8, 8);
 			} break;
 
 			case 0x0B: // Population
@@ -5585,7 +5585,7 @@
 	 * On the other hand, why 1930? Just 'fix' the houses with the lowest
 	 * minimum introduction date to 0.
 	 */
-	Year min_date = MAX_YEAR;
+	Year min_year = MAX_YEAR;
 
 	for (GRFFile *file = _first_grffile; file != NULL; file = file->next) {
 		if (file->housespec == NULL) continue;
@@ -5594,16 +5594,16 @@
 			HouseSpec *hs = file->housespec[i];
 			if (hs != NULL) {
 				_house_mngr.SetEntitySpec(hs);
-				if (hs->min_date < min_date) min_date = hs->min_date;
+				if (hs->min_year < min_year) min_year = hs->min_year;
 			}
 		}
 	}
 
-	if (min_date != 0) {
+	if (min_year != 0) {
 		for (int i = 0; i < HOUSE_MAX; i++) {
 			HouseSpec *hs = GetHouseSpecs(i);
 
-			if (hs->enabled && hs->min_date == min_date) hs->min_date = 0;
+			if (hs->enabled && hs->min_year == min_year) hs->min_year = 0;
 		}
 	}
 }
--- a/src/table/town_land.h	Tue Jun 03 02:20:27 2008 +0000
+++ b/src/table/town_land.h	Tue Jun 03 03:06:16 2008 +0000
@@ -1809,8 +1809,8 @@
 	/**
 	 *                                                              remove_rating_decrease
 	 *                                                               |    mail_generation
-	 *     min_date                                                  |    |    1st CargoID acceptance
-	 *     |         max_date                                        |    |    |    2nd CargoID acceptance
+	 *     min_year                                                  |    |    1st CargoID acceptance
+	 *     |         max_year                                        |    |    |    2nd CargoID acceptance
 	 *     |         |    population                                 |    |    |    |    3th CargoID acceptance
 	 *     |         |    |    removal_cost                          |    |    |    |    |
 	 *     |         |    |    |    building_name                    |    |    |    |    |
--- a/src/town.h	Tue Jun 03 02:20:27 2008 +0000
+++ b/src/town.h	Tue Jun 03 03:06:16 2008 +0000
@@ -212,8 +212,8 @@
 
 struct HouseSpec {
 	/* Standard properties */
-	Year min_date;                     ///< introduction year of the house
-	Year max_date;                     ///< last year it can be built
+	Year min_year;                     ///< introduction year of the house
+	Year max_year;                     ///< last year it can be built
 	byte population;                   ///< population (Zero on other tiles in multi tile house.)
 	byte removal_cost;                 ///< cost multiplier for removing it
 	StringID building_name;            ///< building name
--- a/src/town_cmd.cpp	Tue Jun 03 02:20:27 2008 +0000
+++ b/src/town_cmd.cpp	Tue Jun 03 03:06:16 2008 +0000
@@ -1931,7 +1931,7 @@
 			}
 		}
 
-		if (_cur_year < hs->min_date || _cur_year > hs->max_date) continue;
+		if (_cur_year < hs->min_year || _cur_year > hs->max_year) continue;
 
 		/* Special houses that there can be only one of. */
 		uint oneof = 0;