mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r3423) - NewGRF: Update the base_intro age at which an engine will have a randomized intro date, as per (the now updated) spec.
This commit is contained in:
parent
21ba849dbd
commit
c2479bbccc
5
engine.c
5
engine.c
@ -209,8 +209,11 @@ void StartupEngines(void)
|
|||||||
e->flags = 0;
|
e->flags = 0;
|
||||||
e->player_avail = 0;
|
e->player_avail = 0;
|
||||||
|
|
||||||
|
// The magic value of 729 days below comes from the NewGRF spec. If the
|
||||||
|
// base intro date is before 1922 then the random number of days is not
|
||||||
|
// added.
|
||||||
r = Random();
|
r = Random();
|
||||||
e->intro_date = ei->base_intro == 0 ? 0 : GB(r, 0, 9) + ei->base_intro;
|
e->intro_date = ei->base_intro <= 729 ? ei->base_intro : GB(r, 0, 9) + ei->base_intro;
|
||||||
if (e->intro_date <= _date) {
|
if (e->intro_date <= _date) {
|
||||||
e->age = (_date - e->intro_date) >> 5;
|
e->age = (_date - e->intro_date) >> 5;
|
||||||
e->player_avail = (byte)-1;
|
e->player_avail = (byte)-1;
|
||||||
|
Loading…
Reference in New Issue
Block a user