Mercurial > hg > openttd
changeset 8859:40fb100b7b49 draft
(svn r12622) -Fix: infinite loop in case your compiler decides that enums are unsigned by default. Patch by Dominik.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Mon, 07 Apr 2008 22:15:31 +0000 |
parents | c3a3884beb99 |
children | c55cd1fe12f3 |
files | src/road_cmd.cpp |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -875,13 +875,14 @@ /* Must iterate over the roadtypes in a reverse manner because * tram tracks must be removed before the road bits. */ - for (RoadType rt = ROADTYPE_HWAY; rt >= ROADTYPE_ROAD; rt--) { + RoadType rt = ROADTYPE_HWAY; + do { if (HasBit(rts, rt)) { CommandCost tmp_ret = RemoveRoad(tile, flags, GetCrossingRoadBits(tile), rt, false); if (CmdFailed(tmp_ret)) return tmp_ret; ret.AddCost(tmp_ret); } - } + } while (rt-- != ROADTYPE_ROAD); if (flags & DC_EXEC) { DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);