diff options
author | tron <tron@openttd.org> | 2005-07-20 15:29:28 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-20 15:29:28 +0000 |
commit | f09638ad3d3eaf3574086e351a56bf5c14159894 (patch) | |
tree | a82679a91beaee405777f0f3c5e3c45814f1ea5d /aircraft_cmd.c | |
parent | f3645d73073e262d9dba2f4d69a9848be435b7df (diff) | |
download | openttd-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 'aircraft_cmd.c')
-rw-r--r-- | aircraft_cmd.c | 8 |
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) { |