(svn r18381) -Codechange: Add RoadVehicle::IsBus() to simplify some stuff.

This commit is contained in:
frosch
2009-12-02 17:37:02 +00:00
parent 2265202d77
commit 59f9163e37
8 changed files with 25 additions and 14 deletions

View File

@@ -11,7 +11,6 @@
#include "stdafx.h"
#include "company_func.h"
#include "cargotype.h"
#include "roadveh.h"
#include "functions.h"
#include "window_func.h"
@@ -119,7 +118,7 @@ void BaseStation::PostDestructor(size_t index)
*/
RoadStop *Station::GetPrimaryRoadStop(const RoadVehicle *v) const
{
RoadStop *rs = this->GetPrimaryRoadStop(IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK);
RoadStop *rs = this->GetPrimaryRoadStop(v->IsBus() ? ROADSTOP_BUS : ROADSTOP_TRUCK);
for (; rs != NULL; rs = rs->next) {
/* The vehicle cannot go to this roadstop (different roadtype) */