summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-01-24 22:24:47 +0000
committerbjarni <bjarni@openttd.org>2005-01-24 22:24:47 +0000
commite006f89aa3e750ead8cce290d86ee22b2190a582 (patch)
treea40c92393f20c790b63d3d4ac0824541652cd3c3 /train_cmd.c
parentffb2c4de778acd8bb35b43c44b65bb10af05e137 (diff)
downloadopenttd-e006f89aa3e750ead8cce290d86ee22b2190a582.tar.xz
(svn r1652) Fix: train and road vehicle lists are now redrawn when vehicles enters/leaves a depot (Hackykid)
fix: the ship status bar was not updated properly after a breakdown if show_speed was off (Hackykid)
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 8a65b108f..df41334e6 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1336,15 +1336,21 @@ static bool CheckTrainStayInDepot(Vehicle *v)
return false;
if (v->u.rail.force_proceed == 0) {
- if (++v->load_unload_time_rem < 37)
+ if (++v->load_unload_time_rem < 37) {
+ InvalidateWindowClasses(WC_TRAINS_LIST);
return true;
+ }
+
v->load_unload_time_rem = 0;
- if (UpdateSignalsOnSegment(v->tile, v->direction))
+ if (UpdateSignalsOnSegment(v->tile, v->direction)) {
+ InvalidateWindowClasses(WC_TRAINS_LIST);
return true;
+ }
}
VehicleServiceInDepot(v);
+ InvalidateWindowClasses(WC_TRAINS_LIST);
TrainPlayLeaveStationSound(v);
v->u.rail.track = 1;
@@ -2485,7 +2491,7 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
/* Calculate next tile */
tile += TileOffsByDir(t);
// determine the track status on the next tile.
- ts = GetTileTrackStatus(tile, TRANSPORT_RAIL) & _reachable_tracks[t];
+ ts = GetTileTrackStatus(tile, TRANSPORT_RAIL) & _reachable_tracks[t];
/* Calc position within the current tile ?? */
x = v->x_pos & 0xF;
@@ -2690,6 +2696,7 @@ void TrainEnterDepot(Vehicle *v, uint tile)
}
}
}
+ InvalidateWindowClasses(WC_TRAINS_LIST);
}
static void CheckIfTrainNeedsService(Vehicle *v)
@@ -2797,7 +2804,7 @@ void OnNewDay_Train(Vehicle *v)
SubtractMoneyFromPlayerFract(v->owner, cost);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
- InvalidateWindow(WC_TRAINS_LIST, v->owner);
+ InvalidateWindowClasses(WC_TRAINS_LIST);
}
}
}