forked from mirror/OpenTTD
(svn r11046) -Codechange: added function to get the next movable (non-articulated, non-read end of dualheaded engine) vehicle in a train
This commit is contained in:
13
src/train.h
13
src/train.h
@@ -248,6 +248,19 @@ static inline Vehicle *GetNextVehicle(const Vehicle *v)
|
||||
return v->Next();
|
||||
}
|
||||
|
||||
/** Get the next real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.
|
||||
* @param v Vehicle.
|
||||
* @return Next vehicle in the consist.
|
||||
*/
|
||||
static inline Vehicle *GetNextUnit(Vehicle *v)
|
||||
{
|
||||
assert(v->type == VEH_TRAIN);
|
||||
v = GetNextVehicle(v);
|
||||
if (v != NULL && IsRearDualheaded(v)) v = v->Next();
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
void ConvertOldMultiheadToNew();
|
||||
void ConnectMultiheadedTrains();
|
||||
uint CountArticulatedParts(EngineID engine_type);
|
||||
|
Reference in New Issue
Block a user