(svn r10097) -Feature: Add support for articulated road vehicles, or callbacks 11 and 17 for

road vehicles for those who prefer the technical explanation.
This commit is contained in:
maedhros
2007-06-11 14:00:16 +00:00
parent be0f5cf877
commit 3e326085fa
21 changed files with 570 additions and 212 deletions

View File

@@ -507,7 +507,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
switch (variable) {
case 0x40: // Get length of consist
case 0x41: // Get length of same consecutive wagons
if (v->type != VEH_TRAIN) return 1;
if (!v->HasFront()) return 1;
{
const Vehicle* u;
@@ -830,7 +830,7 @@ static inline void NewVehicleResolver(ResolverObject *res, EngineID engine_type,
res->ResolveReal = &VehicleResolveReal;
res->u.vehicle.self = v;
res->u.vehicle.parent = (v != NULL && v->type == VEH_TRAIN) ? GetFirstVehicleInChain(v) : v;
res->u.vehicle.parent = (v != NULL && v->HasFront()) ? GetFirstVehicleInChain(v) : v;
res->u.vehicle.self_type = engine_type;