From ea63050d5f6e33e32917ff0df670638197a5ec05 Mon Sep 17 00:00:00 2001 From: bjarni Date: Tue, 3 Oct 2006 14:52:39 +0000 Subject: (svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders) Example: make a train transport iron ore from A to B, then it visits a depot and refits to steel It then transport steel back to A or near A if there is a factory and then it visits another depot to refit to iron ore again This is controlled in the orders. If a goto depot order is lightlighted, then "Unload" changes to "Refit" Control click "Refit" removes the refit part of the order (as the tooltip says) The player will still pay the normal refit costs Known issues: If a vehicle is not in a depot, then the refit window will fail to tell refitted cargo capacity Refit costs in the refit window can sometimes print 0 when it should not because the refit calculation is unaware that the vehicle will be refitted in between Warning: autoreplace got a protection against replacing something so you get a new cargo type, but it can fail here. In the iron ore/steel example, it can see that the vehicle carries iron ore and the new one can be refitted to iron ore, then it will replace. It will not check to see that it's valid for steel as well. This is something to look into in the future --- order.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'order.h') diff --git a/order.h b/order.h index e3c2d1d9d..fd7f96e7e 100644 --- a/order.h +++ b/order.h @@ -9,7 +9,8 @@ #include "pool.h" enum { - INVALID_ORDER = 0xFFFF, + INVALID_VEH_ORDER_ID = 0xFF, + INVALID_ORDER = 0xFFFF, }; /* Order types */ @@ -88,6 +89,9 @@ typedef struct Order { struct Order *next; ///< Pointer to next order. If NULL, end of list OrderID index; ///< Index of the order, is not saved or anything, just for reference + + CargoID refit_cargo; // Refit CargoID + byte refit_subtype; // Refit subtype } Order; #define MAX_BACKUP_ORDER_COUNT 40 -- cgit v1.2.3-54-g00ecf