|
@@ -1421,15 +1421,15 @@ SpriteID GetEnginePalette(EngineID engin
|
|
|
return GetEngineColourMap(engine_type, company, INVALID_ENGINE, NULL);
|
|
|
}
|
|
|
|
|
|
SpriteID GetVehiclePalette(const Vehicle *v)
|
|
|
{
|
|
|
if (v->type == VEH_TRAIN) {
|
|
|
return GetEngineColourMap(v->engine_type, v->owner, ((Train *)v)->tcache.first_engine, v);
|
|
|
return GetEngineColourMap(v->engine_type, v->owner, ((const Train *)v)->tcache.first_engine, v);
|
|
|
} else if (v->type == VEH_ROAD) {
|
|
|
return GetEngineColourMap(v->engine_type, v->owner, ((RoadVehicle *)v)->rcache.first_engine, v);
|
|
|
return GetEngineColourMap(v->engine_type, v->owner, ((const RoadVehicle *)v)->rcache.first_engine, v);
|
|
|
}
|
|
|
|
|
|
return GetEngineColourMap(v->engine_type, v->owner, INVALID_ENGINE, v);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1739,10 +1739,10 @@ bool CanVehicleUseStation(EngineID engin
|
|
|
* @param v the vehicle to test
|
|
|
* @param st the station to test for
|
|
|
* @return true if and only if the vehicle can use this station.
|
|
|
*/
|
|
|
bool CanVehicleUseStation(const Vehicle *v, const Station *st)
|
|
|
{
|
|
|
if (v->type == VEH_ROAD) return st->GetPrimaryRoadStop((RoadVehicle *)v) != NULL;
|
|
|
if (v->type == VEH_ROAD) return st->GetPrimaryRoadStop((const RoadVehicle *)v) != NULL;
|
|
|
|
|
|
return CanVehicleUseStation(v->engine_type, st);
|
|
|
}
|