Mercurial > hg > openttd
diff src/vehicle.cpp @ 5763:b7c916fdba99 draft
(svn r8314) -Fix
-Codechange: Move the railtype from EngineInfo to RailVehicleInfo, because having a railtype for non-rail vehicles isn't that useful
author | tron <tron@openttd.org> |
---|---|
date | Sun, 21 Jan 2007 16:08:18 +0000 |
parents | d463e4aecd52 |
children | 88cf2dc7e649 |
line wrap: on
line diff
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2843,12 +2843,12 @@ /* Determine the livery scheme to use */ switch (GetEngine(engine_type)->type) { case VEH_Train: { - switch (_engine_info[engine_type].railtype) { + const RailVehicleInfo *rvi = RailVehInfo(engine_type); + + switch (rvi->railtype) { case RAILTYPE_RAIL: case RAILTYPE_ELECTRIC: { - const RailVehicleInfo *rvi = RailVehInfo(engine_type); - if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type; if (rvi->flags & RVI_WAGON) { if (cargo_type == CT_PASSENGERS || cargo_type == CT_MAIL || cargo_type == CT_VALUABLES) {