summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2007-03-24 09:12:03 +0000
committercelestar <celestar@openttd.org>2007-03-24 09:12:03 +0000
commit44be40052f0ec958784ab308859e1fd0290e9734 (patch)
tree0609b0f1d83ccc09e2f2cdf84583392216005ed5 /src/station_cmd.cpp
parent6c06a10ffadf36bf1c37e4414053a7a214f79304 (diff)
downloadopenttd-44be40052f0ec958784ab308859e1fd0290e9734.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/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 09153ba39..6341fd7df 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1120,6 +1120,14 @@ static int32 RemoveRailroadStation(Station *st, TileIndex tile, uint32 flags)
return cost;
}
+/**
+ * Switches the rail type at a railway station tile.
+ * @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 DoConvertStationRail(TileIndex tile, RailType totype, bool exec)
{
const Station* st = GetStationByTile(tile);
@@ -1140,7 +1148,7 @@ int32 DoConvertStationRail(TileIndex tile, RailType totype, bool exec)
YapfNotifyTrackLayoutChange(tile, GetRailStationTrack(tile));
}
- return _price.build_rail >> 1;
+ return _price.build_rail / 2;
}
/**