summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-02-07 19:10:19 +0000
committerbjarni <bjarni@openttd.org>2007-02-07 19:10:19 +0000
commit037d6367349afa5a27ddf2cf015f6490167cf786 (patch)
treeb16bae58b03b0c68fe0ab88a8311dd7f6406238a /src/order_cmd.cpp
parent5666d8d7272ff24116049757dc2405b55cfd4b97 (diff)
downloadopenttd-037d6367349afa5a27ddf2cf015f6490167cf786.tar.xz
(svn r8621) -Codechange: assigned new numbers to the VEH_(type) enum so that VEH_Train is 0, VEH_Road is 1 and so on
This means that "v->type" can be used as array indexes instead of VehTypeToIndex() (or "v->type - VEH_Train/0x10 as the code still used in some places) Surprisingly this can be done without changing the savegame format
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 7ee0a0901..afe7095ed 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -160,10 +160,10 @@ void AssignOrder(Order *order, Order data)
*/
static void DeleteOrderWarnings(const Vehicle* v)
{
- DeleteVehicleNews(v->index, STR_TRAIN_HAS_TOO_FEW_ORDERS + (v->type - VEH_Train) * 4);
- DeleteVehicleNews(v->index, STR_TRAIN_HAS_VOID_ORDER + (v->type - VEH_Train) * 4);
- DeleteVehicleNews(v->index, STR_TRAIN_HAS_DUPLICATE_ENTRY + (v->type - VEH_Train) * 4);
- DeleteVehicleNews(v->index, STR_TRAIN_HAS_INVALID_ENTRY + (v->type - VEH_Train) * 4);
+ DeleteVehicleNews(v->index, STR_TRAIN_HAS_TOO_FEW_ORDERS + v->type * 4);
+ DeleteVehicleNews(v->index, STR_TRAIN_HAS_VOID_ORDER + v->type * 4);
+ DeleteVehicleNews(v->index, STR_TRAIN_HAS_DUPLICATE_ENTRY + v->type * 4);
+ DeleteVehicleNews(v->index, STR_TRAIN_HAS_INVALID_ENTRY + v->type * 4);
}
@@ -1005,7 +1005,7 @@ void CheckOrders(const Vehicle* v)
/* We don't have a problem */
if (problem_type < 0) return;
- message = STR_TRAIN_HAS_TOO_FEW_ORDERS + ((v->type - VEH_Train) << 2) + problem_type;
+ message = STR_TRAIN_HAS_TOO_FEW_ORDERS + (v->type << 2) + problem_type;
//DEBUG(misc, 3, "Triggered News Item for vehicle %d", v->index);
SetDParam(0, v->unitnumber);