Mercurial > hg > openttd
changeset 3168:ee5658ed56d4 draft
(svn r3796) When unmagicfying code, do it Right(tm) and also give the variables sensible names. I flipped a 'b' and a 'd' in r3785
author | tron <tron@openttd.org> |
---|---|
date | Wed, 08 Mar 2006 19:47:18 +0000 |
parents | 3d360e619f7d |
children | d2df8429c48c |
files | roadveh_cmd.c |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -854,13 +854,13 @@ static Direction RoadVehGetSlidingDirection(const Vehicle* v, int x, int y) { - Direction b = RoadVehGetNewDirection(v, x, y); - Direction d = v->direction; + Direction new = RoadVehGetNewDirection(v, x, y); + Direction old = v->direction; DirDiff delta; - if (b == d) return d; - delta = (DirDifference(d, b) > DIRDIFF_REVERSE ? DIRDIFF_45LEFT : DIRDIFF_45RIGHT); - return ChangeDir(d, delta); + if (new == old) return old; + delta = (DirDifference(new, old) > DIRDIFF_REVERSE ? DIRDIFF_45LEFT : DIRDIFF_45RIGHT); + return ChangeDir(old, delta); } typedef struct OvertakeData {