summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-01-06 22:49:00 +0000
committerpeter1138 <peter1138@openttd.org>2006-01-06 22:49:00 +0000
commit79ce0def50f4d2c3e9956c9a5e7c93d893c1f465 (patch)
tree8a328a4db89773cf80d3659123e36782e8abe45e
parent4cda74cb31953af0ff747430225199770c98a4ef (diff)
downloadopenttd-79ce0def50f4d2c3e9956c9a5e7c93d893c1f465.tar.xz
(svn r3378) - NewGRF Fix: Use order status to determine whether a vehicle is loading instead
of speed, and get that state from first vehicle in a train consist.
-rw-r--r--engine.c7
-rw-r--r--train_cmd.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/engine.c b/engine.c
index 20da2c32d..a2e717f1e 100644
--- a/engine.c
+++ b/engine.c
@@ -608,7 +608,12 @@ int GetCustomEngineSprite(EngineID engine, const Vehicle *v, byte direction)
if (capacity == 0) capacity = 1;
loaded = (v->cargo_count * 100) / capacity;
- in_motion = (v->cur_speed != 0);
+
+ if (v->type == VEH_Train) {
+ in_motion = GetFirstVehicleInChain(v)->current_order.type != OT_LOADING;
+ } else {
+ in_motion = v->current_order.type != OT_LOADING;
+ }
}
group = GetVehicleSpriteGroup(engine, v);
diff --git a/train_cmd.c b/train_cmd.c
index 8e076e935..7ae6b10ff 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2563,10 +2563,10 @@ static void TrainEnterStation(Vehicle *v, StationID station)
SET_EXPENSES_TYPE(EXPENSES_TRAIN_INC);
if (LoadUnloadVehicle(v) != 0) {
InvalidateWindow(WC_TRAINS_LIST, v->owner);
- MarkTrainDirty(v);
TrainCargoChanged(v);
UpdateTrainAcceleration(v);
}
+ MarkTrainDirty(v);
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}