Changeset - r19473:714c71f6bce9
[Not reviewed]
master
0 1 0
frosch - 12 years ago 2012-07-09 18:45:35
frosch@openttd.org
(svn r24390) -Change [FS#5213]: Allow cloning of orders which are unreachable for the destination vehicle if they were already unreachable for the source vehicle. This makes cloning/autorenewing/autoreplacing behave more smooth during station reconstruction.
1 file changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/order_cmd.cpp
Show inline comments
 
@@ -1472,8 +1472,13 @@ CommandCost CmdCloneOrder(TileIndex tile
 
			const Order *order;
 

	
 
			FOR_VEHICLE_ORDERS(src, order) {
 
				if (OrderGoesToStation(dst, order) &&
 
						!CanVehicleUseStation(dst, Station::Get(order->GetDestination()))) {
 
				if (!OrderGoesToStation(dst, order)) continue;
 

	
 
				/* Allow copying unreachable destinations if they were already unreachable for the source.
 
				 * This is basically to allow cloning / autorenewing / autoreplacing vehicles, while the stations
 
				 * are temporarily invalid due to reconstruction. */
 
				const Station *st = Station::Get(order->GetDestination());
 
				if (CanVehicleUseStation(src, st) && !CanVehicleUseStation(dst, st)) {
 
					return_cmd_error(STR_ERROR_CAN_T_COPY_SHARE_ORDER);
 
				}
 
			}
0 comments (0 inline, 0 general)