From 500a7e6627c130d3ec8bae00384dafe18e86da7e Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 4 Feb 2006 21:48:46 +0000 Subject: (svn r3546) - NewGRF feature: Implement rail vehicle 'property' 0x1A: allows shuffling order of rail vehicle purchase list (and replace vehicle list) --- newgrf.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'newgrf.c') diff --git a/newgrf.c b/newgrf.c index 109ab68e2..c8f2798d4 100644 --- a/newgrf.c +++ b/newgrf.c @@ -365,6 +365,18 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf rvi[i].engclass = engclass; } } break; + case 0x1A: // Alter purchase list sort order. + FOR_EACH_OBJECT { + EngineID pos = grf_load_byte(&buf); + + if (pos < NUM_TRAIN_ENGINES) { + AlterRailVehListOrder(engine + i, pos); + } else { + grfmsg(GMS_NOTICE, "RailVehicleChangeInfo: Invalid train engine ID %d, ignoring.", pos); + } + } + break; + case 0x1B: { /* Powered wagons power bonus */ FOR_EACH_OBJECT { uint16 wag_power = grf_load_word(&buf); @@ -431,7 +443,6 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf } break; /* TODO */ /* Fall-through for unimplemented one byte long properties. */ - case 0x1A: /* Sort order */ case 0x1C: /* Refit cost */ case 0x1F: /* Tractive effort */ case 0x20: /* Air drag */ @@ -2499,6 +2510,7 @@ static void ResetNewGRFData(void) UnloadWagonOverrides(); UnloadCustomEngineSprites(); UnloadCustomEngineNames(); + ResetEngineListOrder(); // Reset price base data ResetPriceBaseMultipliers(); -- cgit v1.2.3-70-g09d2