# HG changeset patch # User peter1138 # Date 2006-01-06 22:49:00 # Node ID cfdf8709560d24e557b1b2b3de5c44ae100e254f # Parent 985c94381a5a15c441bc4e70a637fba2c5f6879e (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. diff --git a/engine.c b/engine.c --- a/engine.c +++ b/engine.c @@ -608,7 +608,12 @@ int GetCustomEngineSprite(EngineID engin 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 --- a/train_cmd.c +++ b/train_cmd.c @@ -2563,10 +2563,10 @@ static void TrainEnterStation(Vehicle *v 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); }