changeset 15916:f13c23f052f1 draft

(svn r20600) -Fix [FS#4075]: "downscale" a full load order to a load if possible order when removing the order while the vehicle is loading. This to prevent the vehicle from (possibly) staying forever in the station
author rubidium <rubidium@openttd.org>
date Mon, 23 Aug 2010 21:21:41 +0000
parents bb38f90b1402
children 052cfee737ea
files src/order_cmd.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -773,6 +773,9 @@
 			 * on his order list or not */
 			if (sel_ord == u->cur_order_index && u->current_order.IsType(OT_LOADING)) {
 				u->current_order.SetNonStopType(ONSF_STOP_EVERYWHERE);
+				/* When full loading, "cancel" that order so the vehicle doesn't
+				 * stay indefinitely at this station anymore. */
+				if (u->current_order.GetLoadType() & OLFB_FULL_LOAD) u->current_order.SetLoadType(OLF_LOAD_IF_POSSIBLE);
 			}
 
 			/* Update any possible open window of the vehicle */