From bc523186e0f67d15d3ddaa509c3dc93682d32565 Mon Sep 17 00:00:00 2001 From: tron Date: Sun, 21 Jan 2007 16:08:18 +0000 Subject: (svn r8314) -Fix -Codechange: Move the railtype from EngineInfo to RailVehicleInfo, because having a railtype for non-rail vehicles isn't that useful --- src/newgrf.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/newgrf.cpp') diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 0861970f3..cc1a2a05d 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -236,9 +236,9 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf uint8 tracktype = grf_load_byte(&buf); switch (tracktype) { - case 0: ei[i].railtype = rvi[i].engclass == 2 ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL; break; - case 1: ei[i].railtype = RAILTYPE_MONO; break; - case 2: ei[i].railtype = RAILTYPE_MAGLEV; break; + case 0: rvi[i].railtype = rvi[i].engclass == 2 ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL; break; + case 1: rvi[i].railtype = RAILTYPE_MONO; break; + case 2: rvi[i].railtype = RAILTYPE_MAGLEV; break; default: grfmsg(1, "RailVehicleChangeInfo: Invalid track type %d specified, ignoring", tracktype); break; @@ -383,8 +383,8 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf } else { break; } - if (ei[i].railtype == RAILTYPE_RAIL && engclass == 2) ei[i].railtype = RAILTYPE_ELECTRIC; - if (ei[i].railtype == RAILTYPE_ELECTRIC && engclass != 2) ei[i].railtype = RAILTYPE_RAIL; + if (rvi[i].railtype == RAILTYPE_RAIL && engclass == 2) rvi[i].railtype = RAILTYPE_ELECTRIC; + if (rvi[i].railtype == RAILTYPE_ELECTRIC && engclass != 2) rvi[i].railtype = RAILTYPE_RAIL; rvi[i].engclass = engclass; } -- cgit v1.2.3-70-g09d2