summaryrefslogtreecommitdiff
path: root/order.h
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-10-03 14:52:39 +0000
committerbjarni <bjarni@openttd.org>2006-10-03 14:52:39 +0000
commitea63050d5f6e33e32917ff0df670638197a5ec05 (patch)
tree2957d8696ffee8fa709210c52f0ada2ce013e1bd /order.h
parent7b1053c35044e32ef959f3d8ef7a2e3ba06c9568 (diff)
downloadopenttd-ea63050d5f6e33e32917ff0df670638197a5ec05.tar.xz
(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
Diffstat (limited to 'order.h')
-rw-r--r--order.h6
1 files changed, 5 insertions, 1 deletions
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