summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-09-29 17:41:00 +0000
committerbjarni <bjarni@openttd.org>2006-09-29 17:41:00 +0000
commit648c43dde7b7e93af22550c1638f3f352ef79f80 (patch)
tree3fc1bb213da5d769c7b0b02c8a3f716cfca5257f /vehicle.c
parent1445dfddbbb9549665f25c9aa701ac06c9b5066c (diff)
downloadopenttd-648c43dde7b7e93af22550c1638f3f352ef79f80.tar.xz
(svn r6579) -Fix r6552: [depot window] solved a condition where pressing autoreplace in a depot window could result in asserts
It still got an issue where it fails to restart moving vehicles after they are replaced though. The cause of this will hopefully be found shortly
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vehicle.c b/vehicle.c
index 15afae923..92f3189c5 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1729,9 +1729,9 @@ int32 CmdDepotMassAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
(vehicle_type == VEH_Ship && !IsShipInDepot(v) ) ||
(vehicle_type == VEH_Aircraft && !IsAircraftInHangar(v)) ) continue;
- if (stopped) v->vehstatus &= ~VS_STOPPED; // Stop the vehicle
+ if (stopped) v->vehstatus |= VS_STOPPED; // Stop the vehicle
ret = MaybeReplaceVehicle(&v, !(flags & DC_EXEC), false);
- if (stopped) v->vehstatus |= VS_STOPPED; // restart the vehicle if we stopped it for being replaced
+ if (stopped) v->vehstatus &= ~VS_STOPPED; // restart the vehicle if we stopped it for being replaced
if (!CmdFailed(ret)) {
cost += ret;