mirror of https://github.com/OpenTTD/OpenTTD.git
(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.
This commit is contained in:
parent
4cda74cb31
commit
79ce0def50
7
engine.c
7
engine.c
|
@ -608,7 +608,12 @@ int GetCustomEngineSprite(EngineID engine, const Vehicle *v, byte direction)
|
||||||
|
|
||||||
if (capacity == 0) capacity = 1;
|
if (capacity == 0) capacity = 1;
|
||||||
loaded = (v->cargo_count * 100) / capacity;
|
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);
|
group = GetVehicleSpriteGroup(engine, v);
|
||||||
|
|
|
@ -2563,10 +2563,10 @@ static void TrainEnterStation(Vehicle *v, StationID station)
|
||||||
SET_EXPENSES_TYPE(EXPENSES_TRAIN_INC);
|
SET_EXPENSES_TYPE(EXPENSES_TRAIN_INC);
|
||||||
if (LoadUnloadVehicle(v) != 0) {
|
if (LoadUnloadVehicle(v) != 0) {
|
||||||
InvalidateWindow(WC_TRAINS_LIST, v->owner);
|
InvalidateWindow(WC_TRAINS_LIST, v->owner);
|
||||||
MarkTrainDirty(v);
|
|
||||||
TrainCargoChanged(v);
|
TrainCargoChanged(v);
|
||||||
UpdateTrainAcceleration(v);
|
UpdateTrainAcceleration(v);
|
||||||
}
|
}
|
||||||
|
MarkTrainDirty(v);
|
||||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue