--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/roadveh.h Thu Jun 15 14:34:31 2006 +0000
@@ -0,0 +1,15 @@
+/* $Id$ */
+
+#include "vehicle.h"
+
+
+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;
+}
--- a/roadveh_gui.c Thu Jun 15 14:16:57 2006 +0000
+++ b/roadveh_gui.c Thu Jun 15 14:34:31 2006 +0000
@@ -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"
@@ -330,7 +331,7 @@
Vehicle *v;
uint32 h;
v = GetVehicle(w->window_number);
- h = IsTileDepotType(v->tile, TRANSPORT_ROAD) && (v->vehstatus&VS_STOPPED) ? (1<< 7) : (1 << 11);
+ h = IsRoadVehInDepotStopped(v) ? 1 << 7 : 1 << 11;
if (h != w->hidden_state) {
w->hidden_state = h;
SetWindowDirty(w);