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
commitf09638ad3d3eaf3574086e351a56bf5c14159894 (patch)
treea82679a91beaee405777f0f3c5e3c45814f1ea5d /train_cmd.c
parentf3645d73073e262d9dba2f4d69a9848be435b7df (diff)
downloadopenttd-f09638ad3d3eaf3574086e351a56bf5c14159894.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;
}