From 94efc4c3b9b519cf7377b0ae9a40ed2c59058e58 Mon Sep 17 00:00:00 2001 From: frosch Date: Wed, 16 Jun 2010 20:27:59 +0000 Subject: (svn r19992) -Fix [FS#3878]: Clear force_proceed when entering depots and when loading. -Fix (r18515): Resetting of force_proceed on manual stopping did not work. --- src/train_cmd.cpp | 7 +++++-- src/vehicle.cpp | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 74b0b1622..2de4323b3 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2905,6 +2905,9 @@ static void TrainEnterStation(Train *v, StationID station) AI::NewEvent(v->owner, new AIEventStationFirstVehicle(st->index, v->index)); } + v->force_proceed = 0; + SetWindowDirty(WC_VEHICLE_VIEW, v->index); + v->BeginLoading(); StationAnimationTrigger(st, v->tile, STAT_ANIM_TRAIN_ARRIVES); @@ -3876,10 +3879,10 @@ static bool TrainLocoHandler(Train *v, bool mode) int j = v->UpdateSpeed(); /* we need to invalidate the widget if we are stopping from 'Stopping 0 km/h' to 'Stopped' */ - if (v->cur_speed == 0 && v->tcache.last_speed == 0 && (v->vehstatus & VS_STOPPED)) { + if (v->cur_speed == 0 && (v->vehstatus & VS_STOPPED)) { /* If we manually stopped, we're not force-proceeding anymore. */ v->force_proceed = 0; - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowDirty(WC_VEHICLE_VIEW, v->index); } int adv_spd = (v->direction & 1) ? 192 : 256; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 0c0e33a59..ca7544b59 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1061,6 +1061,7 @@ void VehicleEnterDepot(Vehicle *v) UpdateSignalsOnSegment(t->tile, INVALID_DIAGDIR, t->owner); t->wait_counter = 0; + t->force_proceed = 0; ClrBit(t->flags, VRF_TOGGLE_REVERSE); t->ConsistChanged(true); break; @@ -1082,6 +1083,7 @@ void VehicleEnterDepot(Vehicle *v) break; default: NOT_REACHED(); } + SetWindowDirty(WC_VEHICLE_VIEW, v->index); if (v->type != VEH_TRAIN) { /* Trains update the vehicle list when the first unit enters the depot and calls VehicleEnterDepot() when the last unit enters. -- cgit v1.2.3-70-g09d2