mirror of https://github.com/OpenTTD/OpenTTD
(svn r5280) -Backport: r5119
-Fix: If a road vehicle is on a road depot tile and stopped doesn't mean it's in the depot. Use the proper test for thisrelease/0.4
parent
af0354ad24
commit
a8d2aa157a
|
@ -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;
|
||||||
|
}
|
|
@ -4,6 +4,7 @@
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
#include "roadveh.h"
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
@ -330,7 +331,7 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
|
||||||
Vehicle *v;
|
Vehicle *v;
|
||||||
uint32 h;
|
uint32 h;
|
||||||
v = GetVehicle(w->window_number);
|
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) {
|
if (h != w->hidden_state) {
|
||||||
w->hidden_state = h;
|
w->hidden_state = h;
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
|
|
Loading…
Reference in New Issue