1
0
Fork 0

(svn r4696) - NewGRF: add support for vehicle variable 0x60, count vehicle type occurance.

release/0.5
peter1138 2006-05-02 20:17:17 +00:00
parent a2ce9d7535
commit 26f6659ec0
1 changed files with 12 additions and 0 deletions

View File

@ -500,6 +500,18 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case 0x46: /* Motion counter */ case 0x46: /* Motion counter */
return 0; return 0;
/* Variables which use the parameter */
case 0x60: /* Count consist's engine ID occurance */
if (v->type != VEH_Train) return v->engine_type == parameter;
{
uint count = 0;
for (; v != NULL; v = v->next) {
if (v->engine_type == parameter) count++;
}
return count;
}
} }
/* General vehicle properties */ /* General vehicle properties */