Chunnel patch 28393: Codechange: Rework GetOtherTunnelEnd proc.
https://www.tt-forums.net/viewtopic.php?p=1183416#p1183416
This commit is contained in:

committed by
Jonathan G Rennison

parent
ad070b91ea
commit
67e7d12eb7
@@ -36,20 +36,8 @@ Tunnel::~Tunnel()
|
||||
*/
|
||||
TileIndex GetOtherTunnelEnd(TileIndex tile)
|
||||
{
|
||||
DiagDirection dir = GetTunnelBridgeDirection(tile);
|
||||
TileIndexDiff delta = TileOffsByDiagDir(dir);
|
||||
int z = GetTileZ(tile);
|
||||
|
||||
dir = ReverseDiagDir(dir);
|
||||
do {
|
||||
tile += delta;
|
||||
} while (
|
||||
!IsTunnelTile(tile) ||
|
||||
GetTunnelBridgeDirection(tile) != dir ||
|
||||
GetTileZ(tile) != z
|
||||
);
|
||||
|
||||
return tile;
|
||||
Tunnel *t = Tunnel::GetByTile(tile);
|
||||
return t->tile_n == tile ? t->tile_s : t->tile_n;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user