From 272b2ef0e9072c6bf2ee3083c3673ae7773462ab Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 14 Oct 2008 18:38:51 +0000 Subject: (svn r14464) -Codechange: replace (uint)-1 with UINT_MAX (PhilSophus) --- src/openttd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/openttd.cpp') diff --git a/src/openttd.cpp b/src/openttd.cpp index 9d1517474..acccefb26 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1431,7 +1431,7 @@ bool AfterLoadGame() AfterLoadTown(); /* make sure there is a town in the game */ - if (_game_mode == GM_NORMAL && !ClosestTownFromTile(0, (uint)-1)) { + if (_game_mode == GM_NORMAL && !ClosestTownFromTile(0, UINT_MAX)) { SetSaveLoadError(STR_NO_TOWN_IN_SCENARIO); return false; } @@ -1561,13 +1561,13 @@ bool AfterLoadGame() switch (GetTileType(t)) { case MP_HOUSE: _m[t].m4 = _m[t].m2; - SetTownIndex(t, CalcClosestTownFromTile(t, (uint)-1)->index); + SetTownIndex(t, CalcClosestTownFromTile(t, UINT_MAX)->index); break; case MP_ROAD: _m[t].m4 |= (_m[t].m2 << 4); if ((GB(_m[t].m5, 4, 2) == ROAD_TILE_CROSSING ? (Owner)_m[t].m3 : GetTileOwner(t)) == OWNER_TOWN) { - SetTownIndex(t, CalcClosestTownFromTile(t, (uint)-1)->index); + SetTownIndex(t, CalcClosestTownFromTile(t, UINT_MAX)->index); } else { SetTownIndex(t, 0); } @@ -1694,7 +1694,7 @@ bool AfterLoadGame() GetRailType(t) ); } else { - TownID town = IsTileOwner(t, OWNER_TOWN) ? ClosestTownFromTile(t, (uint)-1)->index : 0; + TownID town = IsTileOwner(t, OWNER_TOWN) ? ClosestTownFromTile(t, UINT_MAX)->index : 0; MakeRoadNormal( t, @@ -2142,7 +2142,7 @@ bool AfterLoadGame() if (CheckSavegameVersion(52)) { for (TileIndex t = 0; t < map_size; t++) { if (IsStatueTile(t)) { - _m[t].m2 = CalcClosestTownFromTile(t, (uint)-1)->index; + _m[t].m2 = CalcClosestTownFromTile(t, UINT_MAX)->index; } } } -- cgit v1.2.3-54-g00ecf