From 037d6367349afa5a27ddf2cf015f6490167cf786 Mon Sep 17 00:00:00 2001 From: bjarni Date: Wed, 7 Feb 2007 19:10:19 +0000 Subject: (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 --- src/engine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/engine.h') 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]; -- cgit v1.2.3-54-g00ecf