(svn r2441) -Feature: You can now give transfer order to set up feeder systems
authorcelestar
Wed, 15 Jun 2005 16:58:15 +0000
changeset 1935 f43f062c9498
parent 1934 b3d568113d4d
child 1936 04f01d961206
(svn r2441) -Feature: You can now give transfer order to set up feeder systems
economy.c
functions.h
lang/english.txt
misc_gui.c
order.h
order_cmd.c
order_gui.c
roadveh_cmd.c
saveload.c
station.h
station_cmd.c
train_cmd.c
--- a/economy.c	Wed Jun 15 14:04:48 2005 +0000
+++ b/economy.c	Wed Jun 15 16:58:15 2005 +0000
@@ -1237,26 +1237,14 @@
 	subsidised = CheckSubsidised(s_from, s_to, cargo_type);
 
 	// Increase town's counter for some special goods types
-	{
-		Town *t = s_to->town;
-		if (cargo_type == CT_FOOD) t->new_act_food += num_pieces;
-		if (cargo_type == CT_WATER)  t->new_act_water += num_pieces;
-	}
+	if (cargo_type == CT_FOOD) s_to->town->new_act_food += num_pieces;
+	if (cargo_type == CT_WATER)  s_to->town->new_act_water += num_pieces;
 
 	// Give the goods to the industry.
 	DeliverGoodsToIndustry(s_to->xy, cargo_type, num_pieces);
 
 	// Determine profit
-	{
-		int t = DistanceManhattan(s_from->xy, s_to->xy);
-		int r = num_pieces;
-		profit = 0;
-		do {
-			int u = min(r, 255);
-			r -= u;
-			profit += GetTransportedGoodsIncome(u, t, days_in_transit, cargo_type);
-		} while (r != 0);
-	}
+	profit = GetTransportedGoodsIncome(num_pieces, DistanceManhattan(s_from->xy, s_to->xy), days_in_transit, cargo_type);
 
 	// Modify profit if a subsidy is in effect
 	if (subsidised) {
@@ -1338,6 +1326,8 @@
 int LoadUnloadVehicle(Vehicle *v)
 {
 	int profit = 0;
+	int v_profit; //virtual profit for feeder systems
+	int v_profit_total = 0;
 	int unloading_time = 20;
 	Vehicle *u = v;
 	int result = 0;
@@ -1365,7 +1355,7 @@
 
 		/* unload? */
 		if (v->cargo_count != 0) {
-			if (v->cargo_source != last_visited && ge->waiting_acceptance & 0x8000) {
+			if ( v->cargo_source != last_visited && ge->waiting_acceptance & 0x8000 && !(u->current_order.flags & OF_TRANSFER) ) {
 				// deliver goods to the station
 				st->time_since_unload = 0;
 
@@ -1373,10 +1363,20 @@
 				profit += DeliverGoods(v->cargo_count, v->cargo_type, v->cargo_source, last_visited, v->cargo_days);
 				result |= 1;
 				v->cargo_count = 0;
-			} else if (u->current_order.flags & OF_UNLOAD) {
+			} else if (u->current_order.flags & ( OF_UNLOAD | OF_TRANSFER) ) {
 				/* unload goods and let it wait at the station */
 				st->time_since_unload = 0;
 
+				v_profit = GetTransportedGoodsIncome(
+						v->cargo_count,
+						DistanceManhattan(GetStation(v->cargo_source)->xy, GetStation(last_visited)->xy),
+						v->cargo_days,
+						v->cargo_type) * 3 / 2;
+
+				v_profit_total += v_profit;
+
+
+				unloading_time += v->cargo_count;
 				if ((t=ge->waiting_acceptance & 0xFFF) == 0) {
 					// No goods waiting at station
 					ge->enroute_time = v->cargo_days;
@@ -1390,6 +1390,8 @@
 				}
 				// Update amount of waiting cargo
 				ge->waiting_acceptance = (ge->waiting_acceptance &~0xFFF) | min(v->cargo_count + t, 0xFFF);
+				ge->feeder_profit += v_profit;
+				u->profit_this_year += v_profit;
 				result |= 2;
 				v->cargo_count = 0;
 			}
@@ -1415,6 +1417,9 @@
 		//  has capacity for it, load it on the vehicle.
 		if ((count=ge->waiting_acceptance & 0xFFF) != 0 &&
 				(cap = v->cargo_cap - v->cargo_count) != 0) {
+			int cargoshare;
+			int feeder_profit_share;
+
 			if (v->cargo_count == 0)
 				TriggerVehicle(v, VEHICLE_TRIGGER_NEW_CARGO);
 
@@ -1432,21 +1437,29 @@
 			completely_empty = false;
 
 			if (cap > count) cap = count;
+			cargoshare = cap * 10000 / ge->waiting_acceptance;
+			feeder_profit_share = ge->feeder_profit * cargoshare / 10000;
 			v->cargo_count += cap;
 			ge->waiting_acceptance -= cap;
+			v->profit_this_year -= feeder_profit_share;
+			ge->feeder_profit -= feeder_profit_share;
 			unloading_time += cap;
 			st->time_since_load = 0;
 
 			// And record the source of the cargo, and the days in travel.
-			v->cargo_source = ge->enroute_from;
+			v->cargo_source = st->index;	//changed this for feeder systems
 			v->cargo_days = ge->enroute_time;
 			result |= 2;
 			st->last_vehicle = v->index;
 		}
 	}
 
+
 	v = u;
 
+	if (v_profit_total > 0)
+		ShowFeederIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, v_profit_total);
+
 	if (v->type == VEH_Train) {
 		int num = - (int)GetStationPlatforms(st, v->tile) * 2;
 		do num++; while ( (v=v->next) != NULL);
--- a/functions.h	Wed Jun 15 14:04:48 2005 +0000
+++ b/functions.h	Wed Jun 15 16:58:15 2005 +0000
@@ -193,6 +193,7 @@
 bool EnsureNoVehicleZ(TileIndex tile, byte z);
 void MarkAllViewportsDirty(int left, int top, int right, int bottom);
 void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost);
+void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost);
 
 void DrawFoundation(TileInfo *ti, uint f);
 
--- a/lang/english.txt	Wed Jun 15 14:04:48 2005 +0000
+++ b/lang/english.txt	Wed Jun 15 16:58:15 2005 +0000
@@ -1425,6 +1425,8 @@
 STR_0801_COST                                                   :{RED}Cost: {CURRENCY}
 STR_0802_INCOME                                                 :{TINYFONT}{GREEN}Income: {CURRENCY}
 STR_0803_INCOME                                                 :{GREEN}Income: {CURRENCY}
+STR_FEEDER_TINY                                                 :{TINYFONT}{YELLOW}Transfer: {CURRENCY}
+STR_FEEDER                                                      :{YELLOW}Transfer: {CURRENCY}
 STR_0804_ESTIMATED_COST                                         :{TINYFONT}{WHITE}Estimated Cost: {CURRENCY}
 STR_0805_ESTIMATED_COST                                         :{WHITE}Estimated Cost: {CURRENCY}
 STR_0806_ESTIMATED_INCOME                                       :{TINYFONT}{WHITE}Estimated Income: {CURRENCY}
@@ -2399,14 +2401,18 @@
 STR_8804                                                        :{SETX 10}{COMMA8}: {STRING}
 STR_8805                                                        :{RIGHTARROW}{SETX 10}{COMMA8}: {STRING}
 STR_8806_GO_TO                                                  :Go to {STATION}
-STR_8807_GO_TO_UNLOAD                                           :Go to {STATION} (Unload)
-STR_8808_GO_TO_LOAD                                             :Go to {STATION} (Load)
-STR_8809                                                        :
-STR_880A_GO_NON_STOP_TO                                         :Go non-stop to {STATION}
-STR_880B_GO_NON_STOP_TO_UNLOAD                                  :Go non-stop to {STATION} (Unload)
-STR_880C_GO_NON_STOP_TO_LOAD                                    :Go non-stop to {STATION} (Load)
-STR_880D                                                        :
-STR_880E_GO_TO_TRAIN_DEPOT                                      :Go to {TOWN} Train Depot
+STR_8807_GO_TO_TRANSFER                                         :Go to {STATION} (Transfer and take cargo)
+STR_8808_GO_TO_UNLOAD                                           :Go to {STATION} (Unload)
+STR_8809_GO_TO_TRANSFER_UNLOAD                                  :Go to {STATION} (Transfer and leave empty)
+STR_880A_GO_TO_LOAD                                             :Go to {STATION} (Load)
+STR_880B_GO_TO_TRANSFER_LOAD                                    :Go to {STATION} (Transfer and wait for full load)
+STR_880C_GO_NON_STOP_TO                                         :Go non-stop to {STATION}
+STR_880D_GO_TO_NON_STOP_TRANSFER                                :Go non-stop to {STATION} (Transfer and take cargo)
+STR_880E_GO_NON_STOP_TO_UNLOAD                                  :Go non-stop to {STATION} (Unload)
+STR_880F_GO_TO_NON_STOP_TRANSFER_UNLOAD                         :Go non-stop to {STATION} (Transfer and leave empty)
+STR_8810_GO_NON_STOP_TO_LOAD                                    :Go non-stop to {STATION} (Load)
+STR_8811_GO_TO_NON_STOP_TRANSFER_LOAD                           :Go non-stop to {STATION} (Transfer and wait for full load)
+STR_GO_TO_TRAIN_DEPOT                                           :Go to {TOWN} Train Depot
 STR_SERVICE_AT_TRAIN_DEPOT                                      :Service at {TOWN} Train Depot
 STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT                             :Go non-stop to {TOWN} Train Depot
 STR_SERVICE_NON_STOP_AT_TRAIN_DEPOT                             :Service non-stop at {TOWN} Train Depot
@@ -2510,6 +2516,8 @@
 STR_8869_CAN_T_REVERSE_DIRECTION                                :{WHITE}Can't reverse direction of train...
 STR_886A_RENAME_TRAIN_VEHICLE_TYPE                              :{WHITE}Rename train vehicle type
 STR_886B_CAN_T_RENAME_TRAIN_VEHICLE                             :{WHITE}Can't rename train vehicle type...
+STR_886D_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order force the vehicle to dump cargo
+STR_886F_TRANSFER                                               :{BLACK}Transfer
 
 STR_TRAIN_STOPPING                                              :{RED}Stopping
 STR_TRAIN_STOPPING_VEL                                          :{RED}Stopping, {VELOCITY}
--- a/misc_gui.c	Wed Jun 15 14:04:48 2005 +0000
+++ b/misc_gui.c	Wed Jun 15 16:58:15 2005 +0000
@@ -593,6 +593,14 @@
 	AddTextEffect(msg, pt.x, pt.y, 0x250);
 }
 
+void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost)
+{
+	Point pt = RemapCoords(x,y,z);
+
+	SetDParam(0, cost);
+	AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250);
+}
+
 static Widget _tooltips_widgets[] = {
 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   199,     0,    31, 0x0, STR_NULL},
 {   WIDGETS_END},
--- a/order.h	Wed Jun 15 14:04:48 2005 +0000
+++ b/order.h	Wed Jun 15 16:58:15 2005 +0000
@@ -19,6 +19,7 @@
 /* Order flag masks - these are for direct bit operations */
 enum {
 	//Flags for stations:
+	OF_TRANSFER       = 0x1,
 	OF_UNLOAD         = 0x2,
 	OF_FULL_LOAD      = 0x4, // Also used when to force an aircraft into a depot
 
@@ -32,6 +33,7 @@
 
 /* Order flags bits - these are for the *BIT macros */
 enum {
+	OFB_TRANSFER       = 0,
 	OFB_UNLOAD         = 1,
 	OFB_FULL_LOAD      = 2,
 	OFB_PART_OF_ORDERS = 1,
--- a/order_cmd.c	Wed Jun 15 14:04:48 2005 +0000
+++ b/order_cmd.c	Wed Jun 15 16:58:15 2005 +0000
@@ -523,7 +523,7 @@
 	VehicleID veh = p1 & 0xFFFF;
 
 	if (!IsVehicleIndex(veh)) return CMD_ERROR;
-	if (p2 != OFB_FULL_LOAD && p2 != OFB_UNLOAD && p2 != OFB_NON_STOP) return CMD_ERROR;
+	if (p2 != OFB_FULL_LOAD && p2 != OFB_UNLOAD && p2 != OFB_NON_STOP && p2 != OFB_TRANSFER) return CMD_ERROR;
 
 	v = GetVehicle(veh);
 	if (v->type == 0 || !CheckOwnership(v->owner)) return CMD_ERROR;
@@ -551,6 +551,9 @@
 		case OFB_NON_STOP:
 			TOGGLEBIT(order->flags, OFB_NON_STOP);
 			break;
+		case OFB_TRANSFER:
+			TOGGLEBIT(order->flags, OFB_TRANSFER);
+			break;
 		default: NOT_REACHED();
 		}
 
--- a/order_gui.c	Wed Jun 15 14:04:48 2005 +0000
+++ b/order_gui.c	Wed Jun 15 16:58:15 2005 +0000
@@ -26,6 +26,23 @@
 	return num;
 }
 
+static StringID StationOrderStrings[] = {
+	STR_8807_GO_TO_TRANSFER,
+	STR_8808_GO_TO_UNLOAD,
+	STR_8809_GO_TO_TRANSFER_UNLOAD,
+	STR_880A_GO_TO_LOAD,
+	STR_880B_GO_TO_TRANSFER_LOAD,
+	STR_NULL,
+	STR_NULL,
+	STR_880C_GO_NON_STOP_TO,
+	STR_880D_GO_TO_NON_STOP_TRANSFER,
+	STR_880E_GO_NON_STOP_TO_UNLOAD,
+	STR_880F_GO_TO_NON_STOP_TRANSFER_UNLOAD,
+	STR_8810_GO_NON_STOP_TO_LOAD,
+	STR_8811_GO_TO_NON_STOP_TRANSFER_LOAD,
+	STR_NULL
+};
+
 static void DrawOrdersWindow(Window *w)
 {
 	const Vehicle *v;
@@ -44,7 +61,8 @@
 		1 << 6 |   //non-stop
 		1 << 7 |   //go-to
 		1 << 8 |   //full load
-		1 << 9     //unload
+		1 << 9 |   //unload
+		1 << 10    //transfer
 		);
 
 	if (v->type != VEH_Train)
@@ -71,12 +89,14 @@
 				break;
 			case OT_GOTO_DEPOT:
 				SETBIT(w->disabled_state, 9);	/* unload */
+				SETBIT(w->disabled_state, 10); /* transfer */
 				SetDParam(2,STR_SERVICE);
 				break;
 
 			case OT_GOTO_WAYPOINT:
 				SETBIT(w->disabled_state, 8); /* full load */
 				SETBIT(w->disabled_state, 9); /* unload */
+				SETBIT(w->disabled_state, 10); /* transfer */
 				break;
 
 			default:
@@ -88,6 +108,8 @@
 		SETBIT(w->disabled_state, 6); /* nonstop */
 		SETBIT(w->disabled_state, 8);	/* full load */
 		SETBIT(w->disabled_state, 9);	/* unload */
+		SETBIT(w->disabled_state, 10); /* transfer */
+
 	}
 
 	SetDParam(0, v->string_id);
@@ -105,28 +127,31 @@
 			SetDParam(1, 6);
 
 			if (order->type == OT_GOTO_STATION) {
-				SetDParam(1, STR_8806_GO_TO + (order->flags >> 1));
+				SetDParam(1, StationOrderStrings[order->flags]);
 				SetDParam(2, order->station);
 			} else if (order->type == OT_GOTO_DEPOT) {
 				StringID s = STR_NULL;
+
 				if (v->type == VEH_Aircraft) {
 					s = STR_GO_TO_AIRPORT_HANGAR;
 					SetDParam(2, order->station);
 				} else {
 					SetDParam(2, GetDepot(order->station)->town_index);
+
 					switch (v->type) {
-						case VEH_Train: s = STR_880E_GO_TO_TRAIN_DEPOT;   break;
+						case VEH_Train: s = STR_GO_TO_TRAIN_DEPOT;   break;
 						case VEH_Road:  s = STR_9038_GO_TO_ROADVEH_DEPOT; break;
 						case VEH_Ship:  s = STR_GO_TO_SHIP_DEPOT;         break;
 						default:
 						break;
 					}
+
+					if (v->type == VEH_Train && order->flags & OF_NON_STOP) s += 2;
+					SetDParam(1, s);
 				}
-				if (v->type == VEH_Train && order->flags & OF_NON_STOP)
-					s += 2;
 
 				if (order->flags & OF_FULL_LOAD)
-					s++; /* XXX service */
+					s++; /* service at */
 
 				SetDParam(1, s);
 			} else if (order->type == OT_GOTO_WAYPOINT) {
@@ -322,6 +347,11 @@
 	DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OFB_NON_STOP,  NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
 }
 
+static void OrderClick_Transfer(Window *w, Vehicle *v)
+{
+	DoCommandP(v->tile, v->index + (OrderGetSel(w) <<  16), OFB_TRANSFER, NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
+}
+
 static void OrderClick_Skip(Window *w, Vehicle *v)
 {
 	DoCommandP(v->tile, v->index, 0, NULL, CMD_SKIP_ORDER);
@@ -340,7 +370,8 @@
 	OrderClick_Nonstop,
 	OrderClick_Goto,
 	OrderClick_FullLoad,
-	OrderClick_Unload
+	OrderClick_Unload,
+	OrderClick_Transfer
 };
 
 static const uint16 _order_keycodes[] = {
@@ -419,6 +450,9 @@
 		case 9: /* unload button */
 			OrderClick_Unload(w, v);
 			break;
+		case 10: /* transfer button */
+			OrderClick_Transfer(w, v);
+			break;
 		}
 	} break;
 
@@ -490,22 +524,23 @@
 
 static const Widget _orders_train_widgets[] = {
 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,									STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_RIGHT,   14,    11,   331,     0,    13, STR_8829_ORDERS,					STR_018C_WINDOW_TITLE_DRAG_THIS},
-{      WWT_PANEL,   RESIZE_RB,      14,     0,   319,    14,    75, 0x0,											STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
-{  WWT_SCROLLBAR,   RESIZE_LRB,     14,   320,   331,    14,    75, 0x0,											STR_0190_SCROLL_BAR_SCROLLS_LIST},
+{    WWT_CAPTION,   RESIZE_RIGHT,   14,    11,   384,     0,    13, STR_8829_ORDERS,					STR_018C_WINDOW_TITLE_DRAG_THIS},
+{      WWT_PANEL,   RESIZE_RB,      14,     0,   372,    14,    75, 0x0,											STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
+{  WWT_SCROLLBAR,   RESIZE_LRB,     14,   373,   384,    14,    75, 0x0,											STR_0190_SCROLL_BAR_SCROLLS_LIST},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,     0,    52,    76,    87, STR_8823_SKIP,						STR_8853_SKIP_THE_CURRENT_ORDER},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,    53,   105,    76,    87, STR_8824_DELETE,					STR_8854_DELETE_THE_HIGHLIGHTED},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,   106,   158,    76,    87, STR_8825_NON_STOP,				STR_8855_MAKE_THE_HIGHLIGHTED_ORDER},
 {WWT_NODISTXTBTN,   RESIZE_TB,      14,   159,   211,    76,    87, STR_8826_GO_TO,						STR_8856_INSERT_A_NEW_ORDER_BEFORE},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,   212,   264,    76,    87, STR_FULLLOAD_OR_SERVICE,	STR_NULL},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,   265,   319,    76,    87, STR_8828_UNLOAD,					STR_8858_MAKE_THE_HIGHLIGHTED_ORDER},
-{      WWT_PANEL,   RESIZE_RTB,     14,   320,   319,    76,    87, 0x0,											STR_NULL},
-{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   320,   331,    76,    87, 0x0,											STR_RESIZE_BUTTON},
+{ WWT_PUSHTXTBTN,   RESIZE_TB,      14,   320,   372,    76,    87, STR_886F_TRANSFER, STR_886D_MAKE_THE_HIGHLIGHTED_ORDER},
+{      WWT_PANEL,   RESIZE_RTB,     14,   373,   372,    76,    87, 0x0,											STR_NULL},
+{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   373,   384,    76,    87, 0x0,											STR_RESIZE_BUTTON},
 {   WIDGETS_END},
 };
 
 static const WindowDesc _orders_train_desc = {
-	-1,-1, 332, 88,
+	-1,-1, 385, 88,
 	WC_VEHICLE_ORDERS,WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESTORE_DPARAM | WDF_RESIZABLE,
 	_orders_train_widgets,
@@ -514,23 +549,23 @@
 
 static const Widget _orders_widgets[] = {
 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,									STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_RIGHT,   14,    11,   331,     0,    13, STR_8829_ORDERS,					STR_018C_WINDOW_TITLE_DRAG_THIS},
-{      WWT_PANEL,   RESIZE_RB,      14,     0,   319,    14,    75, 0x0,											STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
-{  WWT_SCROLLBAR,   RESIZE_LRB,     14,   320,   331,    14,    75, 0x0,											STR_0190_SCROLL_BAR_SCROLLS_LIST},
-
+{    WWT_CAPTION,   RESIZE_RIGHT,   14,    11,   395,     0,    13, STR_8829_ORDERS,					STR_018C_WINDOW_TITLE_DRAG_THIS},
+{      WWT_PANEL,   RESIZE_RB,      14,     0,   383,    14,    75, 0x0,											STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
+{  WWT_SCROLLBAR,   RESIZE_LRB,     14,   384,   395,    14,    75, 0x0,											STR_0190_SCROLL_BAR_SCROLLS_LIST},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,     0,    63,    76,    87, STR_8823_SKIP,						STR_8853_SKIP_THE_CURRENT_ORDER},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,    64,   128,    76,    87, STR_8824_DELETE,					STR_8854_DELETE_THE_HIGHLIGHTED},
 {      WWT_EMPTY,   RESIZE_TB,      14,     0,     0,    76,    87, 0x0,											0x0},
 {WWT_NODISTXTBTN,   RESIZE_TB,      14,   129,   192,    76,    87, STR_8826_GO_TO,						STR_8856_INSERT_A_NEW_ORDER_BEFORE},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,   193,   256,    76,    87, STR_FULLLOAD_OR_SERVICE,	STR_NULL},
 { WWT_PUSHTXTBTN,   RESIZE_TB,      14,   257,   319,    76,    87, STR_8828_UNLOAD,					STR_8858_MAKE_THE_HIGHLIGHTED_ORDER},
-{      WWT_PANEL,   RESIZE_RTB,     14,   320,   319,    76,    87, 0x0,											STR_NULL},
-{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   320,   331,    76,    87, 0x0,											STR_RESIZE_BUTTON},
+{ WWT_PUSHTXTBTN,   RESIZE_TB,    14,   320,   383,    76,    87, STR_886F_TRANSFER, STR_886D_MAKE_THE_HIGHLIGHTED_ORDER},
+{      WWT_PANEL,   RESIZE_RTB,     14,   384,   383,    76,    87, 0x0,											STR_NULL},
+{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   384,   395,    76,    87, 0x0,											STR_RESIZE_BUTTON},
 {   WIDGETS_END},
 };
 
 static const WindowDesc _orders_desc = {
-	-1,-1, 332, 88,
+	-1,-1, 396, 88,
 	WC_VEHICLE_ORDERS,WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESTORE_DPARAM | WDF_RESIZABLE,
 	_orders_widgets,
--- a/roadveh_cmd.c	Wed Jun 15 14:04:48 2005 +0000
+++ b/roadveh_cmd.c	Wed Jun 15 16:58:15 2005 +0000
@@ -1472,7 +1472,7 @@
 			if (old_order.type == OT_GOTO_STATION &&
 					v->current_order.station == v->last_station_visited) {
 				v->current_order.flags =
-					(old_order.flags & (OF_FULL_LOAD | OF_UNLOAD)) | OF_NON_STOP;
+					(old_order.flags & (OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER)) | OF_NON_STOP;
 			}
 
 			SET_EXPENSES_TYPE(EXPENSES_ROADVEH_INC);
--- a/saveload.c	Wed Jun 15 14:04:48 2005 +0000
+++ b/saveload.c	Wed Jun 15 16:58:15 2005 +0000
@@ -23,8 +23,8 @@
 #include "saveload.h"
 
 enum {
-	SAVEGAME_MAJOR_VERSION = 13,
-	SAVEGAME_MINOR_VERSION = 0x1,
+	SAVEGAME_MAJOR_VERSION = 14,
+	SAVEGAME_MINOR_VERSION = 0,
 
 	SAVEGAME_LOADABLE_VERSION = (SAVEGAME_MAJOR_VERSION << 8) + SAVEGAME_MINOR_VERSION
 };
--- a/station.h	Wed Jun 15 14:04:48 2005 +0000
+++ b/station.h	Wed Jun 15 16:58:15 2005 +0000
@@ -14,6 +14,7 @@
 	byte enroute_time;
 	byte last_speed;
 	byte last_age;
+	int32 feeder_profit;
 } GoodsEntry;
 
 typedef enum RoadStopType {
--- a/station_cmd.c	Wed Jun 15 14:04:48 2005 +0000
+++ b/station_cmd.c	Wed Jun 15 16:58:15 2005 +0000
@@ -458,6 +458,7 @@
 		ge->rating = 175;
 		ge->last_speed = 0;
 		ge->last_age = 0xFF;
+		ge->feeder_profit = 0;
 	}
 
 	_global_station_sort_dirty = true; // build a new station
@@ -3044,6 +3045,7 @@
 	SLE_VAR(GoodsEntry,enroute_time,			SLE_UINT8),
 	SLE_VAR(GoodsEntry,last_speed,				SLE_UINT8),
 	SLE_VAR(GoodsEntry,last_age,					SLE_UINT8),
+	SLE_CONDVAR(GoodsEntry,feeder_profit,			SLE_INT32, 14, 255),
 
 	SLE_END()
 };
--- a/train_cmd.c	Wed Jun 15 14:04:48 2005 +0000
+++ b/train_cmd.c	Wed Jun 15 16:58:15 2005 +0000
@@ -2327,7 +2327,7 @@
 		// Yeah, keep the load/unload flags
 		// Non Stop now means if the order should be increased.
 		v->current_order.type = OT_LOADING;
-		v->current_order.flags &= OF_FULL_LOAD | OF_UNLOAD;
+		v->current_order.flags &= OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER;
 		v->current_order.flags |= OF_NON_STOP;
 	} else {
 		// No, just do a simple load