Mercurial > hg > openttd
changeset 2604:bc9279c4ac9e draft
(svn r3141) Replace incorrect railtype bitmask in CmdRailTrackHelper with appropriate GB()
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Sat, 05 Nov 2005 18:21:28 +0000 |
parents | ef269df2933f |
children | 9c0de45d8f66 |
files | rail_cmd.c |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/rail_cmd.c +++ b/rail_cmd.c @@ -587,8 +587,9 @@ Track track = (Track)GB(p2, 4, 3); Trackdir trackdir; byte mode = HASBIT(p2, 7); + RailType railtype = (RailType)GB(p2, 0, 4); - if (!ValParamRailtype(p2 & 0x3) || !ValParamTrackOrientation(track)) return CMD_ERROR; + if (!ValParamRailtype(railtype) || !ValParamTrackOrientation(track)) return CMD_ERROR; if (p1 > MapSize()) return CMD_ERROR; trackdir = TrackToTrackdir(track); @@ -603,7 +604,7 @@ if (flags & DC_EXEC) SndPlayTileFx(SND_20_SPLAT_2, TileVirtXY(x, y)); for(;;) { - ret = DoCommand(x, y, p2 & 0x3, TrackdirToTrack(trackdir), flags, (mode == 0) ? CMD_BUILD_SINGLE_RAIL : CMD_REMOVE_SINGLE_RAIL); + ret = DoCommand(x, y, railtype, TrackdirToTrack(trackdir), flags, (mode == 0) ? CMD_BUILD_SINGLE_RAIL : CMD_REMOVE_SINGLE_RAIL); if (CmdFailed(ret)) { if ((_error_message != STR_1007_ALREADY_BUILT) && (mode == 0))