diff options
author | tron <tron@openttd.org> | 2006-06-05 10:23:18 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-06-05 10:23:18 +0000 |
commit | eeeb8172e80eedf59109dced55fe72775340b59d (patch) | |
tree | 35c744c702db39785503087f611946cf4470097d /roadveh_gui.c | |
parent | ddbcd9007c19f535bc4aca7cf01afed05a7b0b3f (diff) | |
download | openttd-eeeb8172e80eedf59109dced55fe72775340b59d.tar.xz |
(svn r5118) Add IsRoadVehInDepot{Stopped,}()
Diffstat (limited to 'roadveh_gui.c')
-rw-r--r-- | roadveh_gui.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/roadveh_gui.c b/roadveh_gui.c index 758463a77..cc4eb7f28 100644 --- a/roadveh_gui.c +++ b/roadveh_gui.c @@ -4,6 +4,7 @@ #include "openttd.h" #include "debug.h" #include "functions.h" +#include "roadveh.h" #include "table/sprites.h" #include "table/strings.h" #include "map.h" @@ -554,7 +555,7 @@ static void DrawRoadDepotWindow(Window *w) /* determine amount of items for scroller */ num = 0; FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile) + if (v->type == VEH_Road && IsRoadVehInDepot(v) && v->tile == tile) num++; } SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap); @@ -571,7 +572,7 @@ static void DrawRoadDepotWindow(Window *w) num = w->vscroll.pos * w->hscroll.cap; FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile && + if (v->type == VEH_Road && IsRoadVehInDepot(v) && v->tile == tile && --num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) { DrawRoadVehImage(v, x+24, y, WP(w,traindepot_d).sel); @@ -608,7 +609,7 @@ static int GetVehicleFromRoadDepotWndPt(const Window *w, int x, int y, Vehicle * tile = w->window_number; FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile && + if (v->type == VEH_Road && IsRoadVehInDepot(v) && v->tile == tile && --pos < 0) { *veh = v; if (xm >= 24) return 0; @@ -917,7 +918,7 @@ static void PlayerRoadVehWndProc(Window *w, WindowEvent *e) DrawVehicleProfitButton(v, x, y + 13); SetDParam(0, v->unitnumber); - if (IsTileDepotType(v->tile, TRANSPORT_ROAD) && (v->vehstatus & VS_HIDDEN)) + if (IsRoadVehInDepot(v)) str = STR_021F; else str = v->age > v->max_age - 366 ? STR_00E3 : STR_00E2; |