diff options
author | peter1138 <peter1138@openttd.org> | 2008-08-24 23:10:23 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-08-24 23:10:23 +0000 |
commit | b45ced35eea5caed622fd93f460d90378326daf7 (patch) | |
tree | 2a46895f22afbc2c7e3bc61f7898ff2404d547f9 /src/rail.h | |
parent | 2f80a277eb88271f2f0534b85bb3fbe97b036e12 (diff) | |
download | openttd-b45ced35eea5caed622fd93f460d90378326daf7.tar.xz |
(svn r14160) -Codechange: Move _railtype_cost_multipliers into the rail type information struct.
Diffstat (limited to 'src/rail.h')
-rw-r--r-- | src/rail.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rail.h b/src/rail.h index 8fa3164c2..7e3cd4b75 100644 --- a/src/rail.h +++ b/src/rail.h @@ -113,6 +113,11 @@ struct RailtypeInfo { * Bit mask of rail type flags */ RailTypeFlags flags; + + /** + * Cost multiplier for building this rail type + */ + uint8 cost_multiplier; }; @@ -154,10 +159,6 @@ static inline bool HasPowerOnRail(RailType enginetype, RailType tiletype) return HasBit(GetRailTypeInfo(enginetype)->powered_railtypes, tiletype); } - -extern int _railtype_cost_multiplier[RAILTYPE_END]; -extern const int _default_railtype_cost_multiplier[RAILTYPE_END]; - /** * Returns the cost of building the specified railtype. * @param railtype The railtype being built. @@ -166,7 +167,7 @@ extern const int _default_railtype_cost_multiplier[RAILTYPE_END]; static inline Money RailBuildCost(RailType railtype) { assert(railtype < RAILTYPE_END); - return (_price.build_rail * _railtype_cost_multiplier[railtype]) >> 3; + return (_price.build_rail * GetRailTypeInfo(railtype)->cost_multiplier) >> 3; } /** |