summaryrefslogtreecommitdiff
path: root/newgrf.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-02-04 21:48:46 +0000
committerpeter1138 <peter1138@openttd.org>2006-02-04 21:48:46 +0000
commit500a7e6627c130d3ec8bae00384dafe18e86da7e (patch)
tree87ce1a898e14813f5cc02bbe02c5671b8f166c37 /newgrf.c
parent78b51cbec2d027a4e8f3066370d5994d4e8b0935 (diff)
downloadopenttd-500a7e6627c130d3ec8bae00384dafe18e86da7e.tar.xz
(svn r3546) - NewGRF feature: Implement rail vehicle 'property' 0x1A: allows shuffling order of rail vehicle purchase list (and replace vehicle list)
Diffstat (limited to 'newgrf.c')
-rw-r--r--newgrf.c14
1 files changed, 13 insertions, 1 deletions
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();