(svn r6579) -Fix r6552: [depot window] solved a condition where pressing autoreplace in a depot window could result in asserts
authorbjarni
Fri, 29 Sep 2006 17:41:00 +0000
changeset 4675 61585e778cc8
parent 4674 206973351c4a
child 4676 e58dba0b7093
(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
vehicle.c
--- a/vehicle.c	Fri Sep 29 16:57:12 2006 +0000
+++ b/vehicle.c	Fri Sep 29 17:41:00 2006 +0000
@@ -1729,9 +1729,9 @@
 			(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;