summaryrefslogtreecommitdiff
path: root/src/roadveh.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-29 21:49:08 +0000
committerrubidium <rubidium@openttd.org>2007-08-29 21:49:08 +0000
commita407d53d1b2a329a5ae747ea83d4652427cc6c8a (patch)
treeeb86df4a79dffa6270deda722c234ab9cb3c8964 /src/roadveh.h
parenta28d33b5dc89e47ae271b5dbdcc4f5e6f1784c6c (diff)
downloadopenttd-a407d53d1b2a329a5ae747ea83d4652427cc6c8a.tar.xz
(svn r11001) -Codechange: unify the way to determine whether a vehicle is in a depot.
Diffstat (limited to 'src/roadveh.h')
-rw-r--r--src/roadveh.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/roadveh.h b/src/roadveh.h
index 7644e3570..5c62fcee0 100644
--- a/src/roadveh.h
+++ b/src/roadveh.h
@@ -45,17 +45,6 @@ static inline bool RoadVehHasArticPart(const Vehicle *v)
}
-static inline bool IsRoadVehInDepot(const Vehicle *v)
-{
- assert(v->type == VEH_ROAD);
- return v->u.road.state == 254;
-}
-
-static inline bool IsRoadVehInDepotStopped(const Vehicle *v)
-{
- return IsRoadVehInDepot(v) && v->vehstatus & VS_STOPPED;
-}
-
void CcBuildRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
@@ -85,6 +74,7 @@ struct RoadVehicle : public Vehicle {
int GetDisplaySpeed() const { return this->cur_speed * 10 / 32; }
int GetDisplayMaxSpeed() const { return this->max_speed * 10 / 32; }
Money GetRunningCost() const { return RoadVehInfo(this->engine_type)->running_cost * _price.roadveh_running; }
+ bool IsInDepot() const { return this->u.road.state == RVSB_IN_DEPOT; }
void Tick();
};