diff options
author | maedhros <maedhros@openttd.org> | 2007-10-14 21:20:12 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-10-14 21:20:12 +0000 |
commit | 675a826601e74390673317bfbbada37dc8d57ec2 (patch) | |
tree | e736c50ab51b5772162a0b2e2bdc1fdc07aae36d /src/rail.h | |
parent | 42761739228fea45f3c561327cae3c609c4f34a1 (diff) | |
download | openttd-675a826601e74390673317bfbbada37dc8d57ec2.tar.xz |
(svn r11265) -Feature: Make more advanced rail types more expensive to build.
Diffstat (limited to 'src/rail.h')
-rw-r--r-- | src/rail.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rail.h b/src/rail.h index c0912d807..36aa83f99 100644 --- a/src/rail.h +++ b/src/rail.h @@ -8,6 +8,7 @@ #include "gfx.h" #include "direction.h" #include "tile.h" +#include "variables.h" /** * Enumeration for all possible railtypes. @@ -791,6 +792,21 @@ static inline bool TracksOverlap(TrackBits bits) return bits != TRACK_BIT_HORZ && bits != TRACK_BIT_VERT; } + +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. + * @return The cost multiplier. + */ +static inline Money RailBuildCost(RailType railtype) +{ + assert(railtype < RAILTYPE_END); + return (_price.build_rail * _railtype_cost_multiplier[railtype]) >> 3; +} + void *UpdateTrainPowerProc(Vehicle *v, void *data); void DrawTrainDepotSprite(int x, int y, int image, RailType railtype); void DrawDefaultWaypointSprite(int x, int y, RailType railtype); |