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/newgrf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/newgrf.cpp') diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 53e1df998..61723b7fb 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3617,7 +3617,7 @@ static void CalculateRefitMasks(void) RailVehInfo(engine)->railveh_type != RAILVEH_WAGON ) )) { - xor_mask = _default_refitmasks[GetEngine(engine)->type - VEH_Train]; + xor_mask = _default_refitmasks[GetEngine(engine)->type]; } } _engine_info[engine].refit_mask = ((mask & ~not_mask) ^ xor_mask) & _landscape_global_cargo_mask[_opt.landscape]; -- cgit v1.2.3-54-g00ecf