summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-02-15 12:53:36 +0000
committerpeter1138 <peter1138@openttd.org>2006-02-15 12:53:36 +0000
commit9936e39924e5df6ecb29853c1ed8082dae8e5107 (patch)
tree89d84610f442eb966c55a6d4213f7a4b4e3c5c61
parentfe7267ca91ffc78eca4cd792d0edd257e04e8f75 (diff)
downloadopenttd-9936e39924e5df6ecb29853c1ed8082dae8e5107.tar.xz
(svn r3606) - NewGRF: Convert from TTDP railtype values to our own railtypes. (These are currently the same, but won't be forever...)
-rw-r--r--newgrf.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/newgrf.c b/newgrf.c
index 155afa828..a4525efb3 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -214,13 +214,21 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
bool ret = false;
switch (prop) {
- case 0x05: { /* Track type */
+ case 0x05: // Track type
FOR_EACH_OBJECT {
uint8 tracktype = grf_load_byte(&buf);
- ei[i].railtype = tracktype;
+ switch (tracktype) {
+ case 0: ei[i].railtype = RAILTYPE_RAIL; break;
+ case 1: ei[i].railtype = RAILTYPE_MONO; break;
+ case 2: ei[i].railtype = RAILTYPE_MAGLEV; break;
+ default:
+ grfmsg(GMS_WARN, "RailVehicleChangeInfo: Invalid track type %d specified, ignoring.", tracktype);
+ break;
+ }
}
- } break;
+ break;
+
case 0x08: { /* AI passenger service */
/* TODO */
FOR_EACH_OBJECT {