diff src/station_cmd.cpp @ 6368:4e4f7827e7ed draft

(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
author celestar <celestar@openttd.org>
date Sat, 24 Mar 2007 09:12:03 +0000 (2007-03-24)
parents 96b1652c6011
children d1cf5ac55918
line wrap: on
line diff
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1120,6 +1120,14 @@
 	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 @@
 		YapfNotifyTrackLayoutChange(tile, GetRailStationTrack(tile));
 	}
 
-	return _price.build_rail >> 1;
+	return _price.build_rail / 2;
 }
 
 /**