equal
deleted
inserted
replaced
86 LoadCustomEngineNames(); |
86 LoadCustomEngineNames(); |
87 } |
87 } |
88 |
88 |
89 static void AdjustAvailAircraft(void) |
89 static void AdjustAvailAircraft(void) |
90 { |
90 { |
91 uint16 date = _date; |
|
92 byte avail = 0; |
91 byte avail = 0; |
93 if (date >= 12784) avail |= 2; // big airport |
92 if (_cur_year >= 1955) avail |= 2; // big airport |
94 if (date < 14610 || _patches.always_small_airport) avail |= 1; // small airport |
93 if (_cur_year < 1960 || _patches.always_small_airport) avail |= 1; // small airport |
95 if (date >= 15706) avail |= 4; // enable heliport |
94 if (_cur_year >= 1963) avail |= 4; // enable heliport |
96 |
95 |
97 if (avail != _avail_aircraft) { |
96 if (avail != _avail_aircraft) { |
98 _avail_aircraft = avail; |
97 _avail_aircraft = avail; |
99 InvalidateWindow(WC_BUILD_STATION, 0); |
98 InvalidateWindow(WC_BUILD_STATION, 0); |
100 } |
99 } |
149 |
148 |
150 // The magic value of 729 days below comes from the NewGRF spec. If the |
149 // The magic value of 729 days below comes from the NewGRF spec. If the |
151 // base intro date is before 1922 then the random number of days is not |
150 // base intro date is before 1922 then the random number of days is not |
152 // added. |
151 // added. |
153 r = Random(); |
152 r = Random(); |
154 e->intro_date = ei->base_intro <= 729 ? ei->base_intro : GB(r, 0, 9) + ei->base_intro; |
153 e->intro_date = ei->base_intro <= ConvertYMDToDate(1922, 0, 1) ? ei->base_intro : (Date)GB(r, 0, 9) + ei->base_intro; |
155 if (e->intro_date <= _date) { |
154 if (e->intro_date <= _date) { |
156 e->age = (_date - e->intro_date) >> 5; |
155 e->age = (_date - e->intro_date) >> 5; |
157 e->player_avail = (byte)-1; |
156 e->player_avail = (byte)-1; |
158 e->flags |= ENGINE_AVAILABLE; |
157 e->flags |= ENGINE_AVAILABLE; |
159 } |
158 } |