mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
(svn r13734) -Fix: NewGRF rail continuation would always mark a tunnel on the same axis as connected, even when the tunnel faces the wrong direction.
This commit is contained in:
parent
f2da045731
commit
bfa66f70b3
@ -25,6 +25,7 @@
|
|||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "animated_tile_func.h"
|
#include "animated_tile_func.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
#include "tunnelbridge_map.h"
|
||||||
|
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
@ -294,11 +295,18 @@ static uint32 GetRailContinuationInfo(TileIndex tile)
|
|||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
for (i = 0; i < lengthof(x_dir); i++, dir++, diagdir++) {
|
for (i = 0; i < lengthof(x_dir); i++, dir++, diagdir++) {
|
||||||
TrackBits trackbits = TrackStatusToTrackBits(GetTileTrackStatus(tile + TileOffsByDir(*dir), TRANSPORT_RAIL, 0));
|
TileIndex neighbour_tile = tile + TileOffsByDir(*dir);
|
||||||
|
TrackBits trackbits = TrackStatusToTrackBits(GetTileTrackStatus(neighbour_tile, TRANSPORT_RAIL, 0));
|
||||||
if (trackbits != TRACK_BIT_NONE) {
|
if (trackbits != TRACK_BIT_NONE) {
|
||||||
/* If there is any track on the tile, set the bit in the second byte */
|
/* If there is any track on the tile, set the bit in the second byte */
|
||||||
SetBit(res, i + 8);
|
SetBit(res, i + 8);
|
||||||
|
|
||||||
|
/* With tunnels and bridges the tile has tracks, but they are not necessarily connected
|
||||||
|
* with the next tile because the ramp is not going in the right direction. */
|
||||||
|
if (IsTileType(neighbour_tile, MP_TUNNELBRIDGE) && GetTunnelBridgeDirection(neighbour_tile) != *diagdir) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* If any track reaches our exit direction, set the bit in the lower byte */
|
/* If any track reaches our exit direction, set the bit in the lower byte */
|
||||||
if (trackbits & DiagdirReachesTracks(*diagdir)) SetBit(res, i);
|
if (trackbits & DiagdirReachesTracks(*diagdir)) SetBit(res, i);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user