mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r16240) -Fix: Make 'stop in depot'-orders only apply on the target depot, not those which are entered on the way to them.
This commit is contained in:
parent
fe5defbacc
commit
ff7f2bdb20
|
@ -600,11 +600,8 @@ Vehicle::~Vehicle()
|
||||||
*/
|
*/
|
||||||
void VehicleEnteredDepotThisTick(Vehicle *v)
|
void VehicleEnteredDepotThisTick(Vehicle *v)
|
||||||
{
|
{
|
||||||
/* Vehicle should stop in the depot if it was in 'stopping' state or
|
/* Vehicle should stop in the depot if it was in 'stopping' state */
|
||||||
* when the vehicle is ordered to halt in the depot. */
|
_vehicles_to_autoreplace[v] = !(v->vehstatus & VS_STOPPED);
|
||||||
_vehicles_to_autoreplace[v] = !(v->vehstatus & VS_STOPPED) &&
|
|
||||||
(!v->current_order.IsType(OT_GOTO_DEPOT) ||
|
|
||||||
!(v->current_order.GetDepotActionType() & ODATFB_HALT));
|
|
||||||
|
|
||||||
/* We ALWAYS set the stopped state. Even when the vehicle does not plan on
|
/* We ALWAYS set the stopped state. Even when the vehicle does not plan on
|
||||||
* stopping in the depot, so we stop it to ensure that it will not reserve
|
* stopping in the depot, so we stop it to ensure that it will not reserve
|
||||||
|
@ -1073,8 +1070,8 @@ void VehicleEnterDepot(Vehicle *v)
|
||||||
v->cur_order_index++;
|
v->cur_order_index++;
|
||||||
}
|
}
|
||||||
if (t.GetDepotActionType() & ODATFB_HALT) {
|
if (t.GetDepotActionType() & ODATFB_HALT) {
|
||||||
/* Force depot visit */
|
/* Vehicles are always stopped on entering depots. Do not restart this one. */
|
||||||
v->vehstatus |= VS_STOPPED;
|
_vehicles_to_autoreplace[v] = false;
|
||||||
if (v->owner == _local_company) {
|
if (v->owner == _local_company) {
|
||||||
StringID string;
|
StringID string;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue