mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 05:15:21 +00:00
(svn r10344) -Fix (r10317): confusion between TRACK_n and TRACK_BIT_n stopped NW/SE slopes being picked up, and compare middle of tile against current z, not previous.
This commit is contained in:
parent
15d4a27c89
commit
a6da8c9519
@ -2536,8 +2536,8 @@ static byte AfterSetTrainPos(Vehicle *v, bool new_tile)
|
|||||||
CLRBIT(v->u.rail.flags, VRF_GOINGUP);
|
CLRBIT(v->u.rail.flags, VRF_GOINGUP);
|
||||||
CLRBIT(v->u.rail.flags, VRF_GOINGDOWN);
|
CLRBIT(v->u.rail.flags, VRF_GOINGDOWN);
|
||||||
|
|
||||||
if ((v->u.rail.track == TRACK_X || v->u.rail.track == TRACK_Y)) {
|
if (v->u.rail.track == TRACK_BIT_X || v->u.rail.track == TRACK_BIT_Y) {
|
||||||
/* Any track that isn't TRACK_X or TRACK_Y cannot be sloped.
|
/* Any track that isn't TRACK_BIT_X or TRACK_BIT_Y cannot be sloped.
|
||||||
* To check whether the current tile is sloped, and in which
|
* To check whether the current tile is sloped, and in which
|
||||||
* direction it is sloped, we get the 'z' at the center of
|
* direction it is sloped, we get the 'z' at the center of
|
||||||
* the tile (middle_z) and the edge of the tile (old_z),
|
* the tile (middle_z) and the edge of the tile (old_z),
|
||||||
@ -2549,7 +2549,7 @@ static byte AfterSetTrainPos(Vehicle *v, bool new_tile)
|
|||||||
|
|
||||||
/* For some reason tunnel tiles are always given as sloped :(
|
/* For some reason tunnel tiles are always given as sloped :(
|
||||||
* But they are not sloped... */
|
* But they are not sloped... */
|
||||||
if (middle_z != old_z && !IsTunnelTile(TileVirtXY(v->x_pos, v->y_pos))) {
|
if (middle_z != v->z_pos && !IsTunnelTile(TileVirtXY(v->x_pos, v->y_pos))) {
|
||||||
SETBIT(v->u.rail.flags, (middle_z > old_z) ? VRF_GOINGUP : VRF_GOINGDOWN);
|
SETBIT(v->u.rail.flags, (middle_z > old_z) ? VRF_GOINGUP : VRF_GOINGDOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user