summaryrefslogtreecommitdiff
path: root/order.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-22 17:13:49 +0000
committertruelight <truelight@openttd.org>2006-08-22 17:13:49 +0000
commit1331b4aa9a525bb87c76c38bbc42d33d099bd026 (patch)
tree6fd89f2a96b8f71b4b34dda81300e4dd18bd4e6e /order.h
parent88d196dff1a8e6f315d865765a05c25da72e11fd (diff)
downloadopenttd-1331b4aa9a525bb87c76c38bbc42d33d099bd026.tar.xz
(svn r6052) -Codechange: change OrderType (order->type) in a typedef
-Codechange: renamed DeleteDestinationFromVehicleOrder to RemoveOrderFromAllVehicles to reflect his function better -Codechange: changed the params of RemoveOrderFromAllVehicles, to avoid unneeded variable-creation
Diffstat (limited to 'order.h')
-rw-r--r--order.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/order.h b/order.h
index 5d0bdb204..ea210063c 100644
--- a/order.h
+++ b/order.h
@@ -10,7 +10,7 @@
#include "pool.h"
/* Order types */
-enum {
+typedef enum OrderTypes {
OT_NOTHING = 0,
OT_GOTO_STATION = 1,
OT_GOTO_DEPOT = 2,
@@ -18,7 +18,7 @@ enum {
OT_LEAVESTATION = 4,
OT_DUMMY = 5,
OT_GOTO_WAYPOINT = 6
-};
+} OrderType;
/* Order flags -- please use OFB instead OF and use HASBIT/SETBIT/CLEARBIT */
@@ -77,7 +77,7 @@ enum {
* - REF_SHEDULE (all REFs are currently limited to 16 bits!!)
*/
typedef struct Order {
- uint8 type;
+ OrderType type;
uint8 flags;
StationID station;
@@ -162,7 +162,7 @@ static inline uint32 PackOrder(const Order *order)
static inline Order UnpackOrder(uint32 packed)
{
Order order;
- order.type = GB(packed, 0, 8);
+ order.type = (OrderType)GB(packed, 0, 8);
order.flags = GB(packed, 8, 8);
order.station = GB(packed, 16, 16);
order.next = NULL;
@@ -173,7 +173,7 @@ static inline Order UnpackOrder(uint32 packed)
/* Functions */
void BackupVehicleOrders(const Vehicle *v, BackuppedOrders *order);
void RestoreVehicleOrders(const Vehicle* v, const BackuppedOrders* order);
-void DeleteDestinationFromVehicleOrder(Order dest);
+void RemoveOrderFromAllVehicles(OrderType type, StationID destination);
void InvalidateVehicleOrder(const Vehicle *v);
bool VehicleHasDepotOrders(const Vehicle *v);
void CheckOrders(const Vehicle*);