summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-04-24 18:30:41 +0000
committerbelugas <belugas@openttd.org>2008-04-24 18:30:41 +0000
commitbf702602c15b71f7e9c35c3632269895a846192b (patch)
treea3cc247eb319cf7b3c8da9ef60321788e4fae10b /src
parentfbeaf0389d95c1e149cb7f9b5f3939a159eba518 (diff)
downloadopenttd-bf702602c15b71f7e9c35c3632269895a846192b.tar.xz
(svn r12875) -Codechange: Use defined const instead of cast magic
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 4261425ac..32e2fa1dd 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -982,7 +982,7 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1,
if (flags & DC_EXEC) {
st = new Station();
- st->town = ClosestTownFromTile(tile_org, (uint)-1);
+ st->town = ClosestTownFromTile(tile_org, UINT_MAX);
GenerateStationName(st, tile_org, STATIONNAMING_RAIL);
if (IsValidPlayer(_current_player)) {
@@ -1406,7 +1406,7 @@ CommandCost CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
st = new Station();
- st->town = ClosestTownFromTile(tile, (uint)-1);
+ st->town = ClosestTownFromTile(tile, UINT_MAX);
GenerateStationName(st, tile, STATIONNAMING_ROAD);
if (IsValidPlayer(_current_player)) {
@@ -1541,7 +1541,7 @@ CommandCost CmdRemoveRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
/* Rebuild the drive throuhg road stop. As a road stop can only be
* removed by the owner of the roadstop, _current_player is the
* owner of the road stop. */
- MakeRoadNormal(tile, road_bits, rts, is_towns_road ? ClosestTownFromTile(tile, (uint)-1)->index : 0,
+ MakeRoadNormal(tile, road_bits, rts, is_towns_road ? ClosestTownFromTile(tile, UINT_MAX)->index : 0,
is_towns_road ? OWNER_TOWN : _current_player, _current_player, _current_player);
}
@@ -1831,7 +1831,7 @@ CommandCost CmdBuildBuoy(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
Station *st = new Station();
- st->town = ClosestTownFromTile(tile, (uint)-1);
+ st->town = ClosestTownFromTile(tile, UINT_MAX);
GenerateStationName(st, tile, STATIONNAMING_BUOY);
if (IsValidPlayer(_current_player)) {
@@ -1991,7 +1991,7 @@ CommandCost CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
st = new Station();
- st->town = ClosestTownFromTile(tile, (uint)-1);
+ st->town = ClosestTownFromTile(tile, UINT_MAX);
GenerateStationName(st, tile, STATIONNAMING_DOCK);
if (IsValidPlayer(_current_player)) {
@@ -2830,7 +2830,7 @@ void BuildOilRig(TileIndex tile)
return;
}
- st->town = ClosestTownFromTile(tile, (uint)-1);
+ st->town = ClosestTownFromTile(tile, UINT_MAX);
st->sign.width_1 = 0;
GenerateStationName(st, tile, STATIONNAMING_OILRIG);