summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-10-05 08:15:51 +0000
committerbjarni <bjarni@openttd.org>2006-10-05 08:15:51 +0000
commitff6f83b56ca48d1590ae7adc8f6f85fbfe7c7424 (patch)
tree09af992dd594d5b616ba90411c39a8baa3fb6380 /vehicle.c
parent7606b2707d5bee3f274e1e0dd58b00decd5110a0 (diff)
downloadopenttd-ff6f83b56ca48d1590ae7adc8f6f85fbfe7c7424.tar.xz
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
This moved a few of the strings and sprites a few pixels. Hopefully this will work out ok.
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/vehicle.c b/vehicle.c
index 469d935e9..44c7221a8 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -2439,6 +2439,18 @@ int32 SendAllVehiclesToDepot(byte type, uint32 flags, bool service, PlayerID own
return (flags & DC_EXEC) ? 0 : CMD_ERROR;
}
+bool IsVehicleInDepot(const Vehicle *v)
+{
+ switch (v->type) {
+ case VEH_Train: return CheckTrainInDepot(v, false) != -1;
+ case VEH_Road: return IsRoadVehInDepot(v);
+ case VEH_Ship: return IsShipInDepot(v);
+ case VEH_Aircraft: return IsAircraftInHangar(v);
+ default: NOT_REACHED();
+ }
+ return false;
+}
+
void VehicleEnterDepot(Vehicle *v)
{
switch (v->type) {