summaryrefslogtreecommitdiff
path: root/aircraft_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 /aircraft_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 'aircraft_cmd.c')
-rw-r--r--aircraft_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c
index e67e21ad0..d5f9d061b 100644
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -1045,13 +1045,13 @@ static void HandleCrashedAircraft(Vehicle *v)
if (v->u.air.crashed_counter < 650) {
if (CHANCE16R(1,32,r)) {
- v->direction = (v->direction+_crashed_aircraft_moddir[(r >> 16)&3]) & 7;
+ v->direction = (v->direction + _crashed_aircraft_moddir[GB(r, 16, 2)]) & 7;
SetAircraftPosition(v, v->x_pos, v->y_pos, v->z_pos);
r = Random();
CreateEffectVehicleRel(v,
- 4 + (r&0xF),
- 4 + ((r>>4)&0xF),
- ((r>>8)&0xF),
+ GB(r, 0, 4) + 4,
+ GB(r, 4, 4) + 4,
+ GB(r, 8, 4),
EV_EXPLOSION_SMALL);
}
} else if (v->u.air.crashed_counter >= 10000) {