mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r7191) -Feature: Add NewGRF support for 32 bit dates, allowing vehicles and bridges to be available before 1920.
This commit is contained in:
parent
d6b98584ab
commit
6766496ad1
20
newgrf.c
20
newgrf.c
@ -488,6 +488,10 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
|||||||
FOR_EACH_OBJECT cargo_disallowed[engine + i] = grf_load_word(&buf);
|
FOR_EACH_OBJECT cargo_disallowed[engine + i] = grf_load_word(&buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x2A: /* Long format introduction date (days since year 0) */
|
||||||
|
FOR_EACH_OBJECT ei[i].base_intro = grf_load_dword(&buf);
|
||||||
|
break;
|
||||||
|
|
||||||
/* TODO */
|
/* TODO */
|
||||||
/* Fall-through for unimplemented one byte long properties. */
|
/* Fall-through for unimplemented one byte long properties. */
|
||||||
case 0x1F: /* Tractive effort */
|
case 0x1F: /* Tractive effort */
|
||||||
@ -603,6 +607,10 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
|||||||
FOR_EACH_OBJECT cargo_disallowed[ROAD_ENGINES_INDEX + engine + i] = grf_load_word(&buf);
|
FOR_EACH_OBJECT cargo_disallowed[ROAD_ENGINES_INDEX + engine + i] = grf_load_word(&buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x1F: /* Long format introduction date (days since year 0) */
|
||||||
|
FOR_EACH_OBJECT ei[i].base_intro = grf_load_dword(&buf);
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x18: /* Tractive effort */
|
case 0x18: /* Tractive effort */
|
||||||
case 0x19: /* Air drag */
|
case 0x19: /* Air drag */
|
||||||
case 0x1B: /* Retire vehicle early */
|
case 0x1B: /* Retire vehicle early */
|
||||||
@ -713,6 +721,10 @@ static bool ShipVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
|||||||
FOR_EACH_OBJECT cargo_disallowed[SHIP_ENGINES_INDEX + engine + i] = grf_load_word(&buf);
|
FOR_EACH_OBJECT cargo_disallowed[SHIP_ENGINES_INDEX + engine + i] = grf_load_word(&buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x1A: /* Long format introduction date (days since year 0) */
|
||||||
|
FOR_EACH_OBJECT ei[i].base_intro = grf_load_dword(&buf);
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x14: /* Ocean speed fraction */
|
case 0x14: /* Ocean speed fraction */
|
||||||
case 0x15: /* Canal speed fraction */
|
case 0x15: /* Canal speed fraction */
|
||||||
case 0x16: /* Retire vehicle early */
|
case 0x16: /* Retire vehicle early */
|
||||||
@ -822,6 +834,10 @@ static bool AircraftVehicleChangeInfo(uint engine, int numinfo, int prop, byte *
|
|||||||
FOR_EACH_OBJECT cargo_disallowed[AIRCRAFT_ENGINES_INDEX + engine + i] = grf_load_word(&buf);
|
FOR_EACH_OBJECT cargo_disallowed[AIRCRAFT_ENGINES_INDEX + engine + i] = grf_load_word(&buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x1A: /* Long format introduction date (days since year 0) */
|
||||||
|
FOR_EACH_OBJECT ei[i].base_intro = grf_load_dword(&buf);
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x16: /* Retire vehicle early */
|
case 0x16: /* Retire vehicle early */
|
||||||
/* TODO */
|
/* TODO */
|
||||||
FOR_EACH_OBJECT grf_load_byte(&buf);
|
FOR_EACH_OBJECT grf_load_byte(&buf);
|
||||||
@ -1110,6 +1126,10 @@ static bool BridgeChangeInfo(uint brid, int numinfo, int prop, byte **bufp, int
|
|||||||
FOR_EACH_OBJECT _bridge[brid + i].flags = grf_load_byte(&buf);
|
FOR_EACH_OBJECT _bridge[brid + i].flags = grf_load_byte(&buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x0F: /* Long format year of availability (year since year 0) */
|
||||||
|
FOR_EACH_OBJECT _bridge[brid + i].avail_year = clamp(grf_load_dword(&buf), MIN_YEAR, MAX_YEAR);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user