summaryrefslogtreecommitdiff
path: root/src/engine.h
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/engine.h
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/engine.h')
-rw-r--r--src/engine.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine.h b/src/engine.h
index df24ee8d5..979dd46c3 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -163,7 +163,7 @@ static inline EngineID GetFirstEngineOfType(byte type)
{
const EngineID start[] = {0, ROAD_ENGINES_INDEX, SHIP_ENGINES_INDEX, AIRCRAFT_ENGINES_INDEX};
- return start[VehTypeToIndex(type)];
+ return start[type];
}
static inline EngineID GetLastEngineOfType(byte type)
@@ -174,7 +174,7 @@ static inline EngineID GetLastEngineOfType(byte type)
SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES,
AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES};
- return end[VehTypeToIndex(type)];
+ return end[type];
}
VARDEF Engine _engines[TOTAL_NUM_ENGINES];