From e006f89aa3e750ead8cce290d86ee22b2190a582 Mon Sep 17 00:00:00 2001 From: bjarni Date: Mon, 24 Jan 2005 22:24:47 +0000 Subject: (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) --- train_cmd.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'train_cmd.c') 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); } } } -- cgit v1.2.3-54-g00ecf