summaryrefslogtreecommitdiff
path: root/train_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 /train_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 'train_cmd.c')
-rw-r--r--train_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 5a5eb70ff..35a3c8250 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -3013,9 +3013,9 @@ static void HandleCrashedTrain(Vehicle *v)
r = Random();
CreateEffectVehicleRel(u,
- 2 + ((r>>8)&7),
- 2 + ((r>>16)&7),
- 5 + (r&7),
+ GB(r, 8, 3) + 2,
+ GB(r, 16, 3) + 2,
+ GB(r, 0, 3) + 5,
EV_EXPLOSION_SMALL);
break;
}