(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
replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
bjarni 18 years ago
parent 1445dfddbb
commit 648c43dde7

@ -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;

Loading…
Cancel
Save