mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-23 22:49:09 +00:00
(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
This commit is contained in:
@@ -854,13 +854,13 @@ static Direction RoadVehGetNewDirection(const Vehicle* v, int x, int y)
|
|||||||
|
|
||||||
static Direction RoadVehGetSlidingDirection(const Vehicle* v, int x, int y)
|
static Direction RoadVehGetSlidingDirection(const Vehicle* v, int x, int y)
|
||||||
{
|
{
|
||||||
Direction b = RoadVehGetNewDirection(v, x, y);
|
Direction new = RoadVehGetNewDirection(v, x, y);
|
||||||
Direction d = v->direction;
|
Direction old = v->direction;
|
||||||
DirDiff delta;
|
DirDiff delta;
|
||||||
|
|
||||||
if (b == d) return d;
|
if (new == old) return old;
|
||||||
delta = (DirDifference(d, b) > DIRDIFF_REVERSE ? DIRDIFF_45LEFT : DIRDIFF_45RIGHT);
|
delta = (DirDifference(new, old) > DIRDIFF_REVERSE ? DIRDIFF_45LEFT : DIRDIFF_45RIGHT);
|
||||||
return ChangeDir(d, delta);
|
return ChangeDir(old, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct OvertakeData {
|
typedef struct OvertakeData {
|
||||||
|
Reference in New Issue
Block a user