Changeset - r15813:7e34c60f1a6d
[Not reviewed]
master
0 1 0
frosch - 14 years ago 2010-08-15 18:25:57
frosch@openttd.org
(svn r20502) -Fix (r12330): VRF_POWEREDWAGON is part of train flags, not vehicle_flags.
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/newgrf_engine.cpp
Show inline comments
 
@@ -670,9 +670,10 @@ static uint32 VehicleGetVariable(const R
 

	
 
			if (v->type == VEH_TRAIN) {
 
				const Train *t = Train::From(v);
 
				const Train *u = t->IsWagon() && HasBit(t->vehicle_flags, VRF_POWEREDWAGON) ? t->First() : t;
 
				bool is_powered_wagon = HasBit(t->flags, VRF_POWEREDWAGON);
 
				const Train *u = is_powered_wagon ? t->First() : t; // for powered wagons the engine defines the type of engine (i.e. railtype)
 
				RailType railtype = GetRailType(v->tile);
 
				bool powered = t->IsEngine() || (t->IsWagon() && HasBit(t->vehicle_flags, VRF_POWEREDWAGON));
 
				bool powered = t->IsEngine() || is_powered_wagon;
 
				bool has_power = HasPowerOnRail(u->railtype, railtype);
 

	
 
				if (powered && has_power) SetBit(modflags, 5);
0 comments (0 inline, 0 general)