diff options
author | celestar <celestar@openttd.org> | 2007-03-24 09:12:03 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2007-03-24 09:12:03 +0000 |
commit | 49ff7cb9389ca6a2611738fae6b338d7e8a83c3b (patch) | |
tree | 0609b0f1d83ccc09e2f2cdf84583392216005ed5 /src/road_cmd.cpp | |
parent | d5f16924d92a7cb793b891118ffc074d902c20a6 (diff) | |
download | openttd-49ff7cb9389ca6a2611738fae6b338d7e8a83c3b.tar.xz |
(svn r9425) -Codechange/Fix (FS#689): Housekeeping in the convert rail functions: Changed the order of error checks to generate more meaningful error messages, added some doxygen comments and replaced bitshifting by proper mathematical operations
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index b95df8bc1..8ffb07aba 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -367,6 +367,14 @@ do_clear:; return cost; } +/** + * Switches the rail type on a level crossing. + * @param tile The tile on which the railtype is to be convert. + * @param totype The railtype we want to convert to + * @param exec Switches between test and execute mode + * @return The cost and state of the operation + * @retval CMD_ERROR An error occured during the operation. + */ int32 DoConvertStreetRail(TileIndex tile, RailType totype, bool exec) { // not a railroad crossing? @@ -386,7 +394,7 @@ int32 DoConvertStreetRail(TileIndex tile, RailType totype, bool exec) YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetCrossingRailBits(tile))); } - return _price.build_rail >> 1; + return _price.build_rail / 2; } |