summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-20 15:29:28 +0000
committertron <tron@openttd.org>2005-07-20 15:29:28 +0000
commitac66e3e28f35c6939d3af68d1f0e26eb9b34e377 (patch)
treea82679a91beaee405777f0f3c5e3c45814f1ea5d /rail_cmd.c
parentf432314fa907d4f3ee63537d399bad64a35033bd (diff)
downloadopenttd-ac66e3e28f35c6939d3af68d1f0e26eb9b34e377.tar.xz
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index f665dbdc0..33e9255cd 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -577,7 +577,7 @@ static int32 CmdRailTrackHelper(int x, int y, uint32 flags, uint32 p1, uint32 p2
{
int ex, ey;
int32 ret, total_cost = 0;
- Track track = (Track)((p2 >> 4) & 7);
+ Track track = (Track)GB(p2, 4, 3);
Trackdir trackdir;
byte mode = HASBIT(p2, 7);
@@ -845,7 +845,7 @@ static int32 CmdSignalTrackHelper(int x, int y, uint32 flags, uint32 p1, uint32
bool error = true;
int mode = p2 & 0x1;
- Track track = (p2 >> 4) & 7;
+ Track track = GB(p2, 4, 3);
Trackdir trackdir = TrackToTrackdir(track);
byte semaphores = (HASBIT(p2, 3)) ? 8 : 0;
byte signal_density = (p2 >> 24);