summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-01-29 17:30:25 +0000
committerterkhen <terkhen@openttd.org>2011-01-29 17:30:25 +0000
commit734994c9ba642f5c75b709d4b44e0c4b993a949a (patch)
treef7f6264f438d4707aaa7e4bfe4c2a223a0c4abba /src/vehicle.cpp
parent50b0e1002621720c6b2cd4b8e20856b86da0b61d (diff)
downloadopenttd-734994c9ba642f5c75b709d4b44e0c4b993a949a.tar.xz
(svn r21924) -Codechange: Unify some parts of the articulated vehicle code.
-Cleanup: Avoid conversions to Train and RoadVehicle that are no longer required.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index f69cf03a5..fe5cf1842 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -626,7 +626,7 @@ bool Vehicle::IsEngineCountable() const
switch (this->type) {
case VEH_AIRCRAFT: return Aircraft::From(this)->IsNormalAircraft(); // don't count plane shadows and helicopter rotors
case VEH_TRAIN:
- return !Train::From(this)->IsArticulatedPart() && // tenders and other articulated parts
+ return !this->IsArticulatedPart() && // tenders and other articulated parts
!Train::From(this)->IsRearDualheaded(); // rear parts of multiheaded engines
case VEH_ROAD: return RoadVehicle::From(this)->IsFrontEngine();
case VEH_SHIP: return true;
@@ -1538,7 +1538,7 @@ LiveryScheme GetEngineLiveryScheme(EngineID engine_type, EngineID parent_engine_
switch (e->type) {
default: NOT_REACHED();
case VEH_TRAIN:
- if (v != NULL && parent_engine_type != INVALID_ENGINE && (UsesWagonOverride(v) || (Train::From(v)->IsArticulatedPart() && e->u.rail.railveh_type != RAILVEH_WAGON))) {
+ if (v != NULL && parent_engine_type != INVALID_ENGINE && (UsesWagonOverride(v) || (v->IsArticulatedPart() && e->u.rail.railveh_type != RAILVEH_WAGON))) {
/* Wagonoverrides use the colour scheme of the front engine.
* Articulated parts use the colour scheme of the first part. (Not supported for articulated wagons) */
engine_type = parent_engine_type;