Files
@ r15560:1ce751e5c273
Branch filter:
Location: cpp/openttd-patchpack/source/src/tunnelbridge.h - annotation
r15560:1ce751e5c273
1.1 KiB
text/x-c
(svn r20230) -Fix [FS#3961]: road vehicles could be dead locked with one way roads. This allows one wayness to be removed if there are vehicles on a tile; it does not allow you to add one wayness to roads that have vehicles on them as it makes turning vehicles jump
r8398:cf5cc32ab397 r8398:cf5cc32ab397 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r14248:a9050881acd7 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8398:cf5cc32ab397 r8973:bd926d7578a7 r8973:bd926d7578a7 r8398:cf5cc32ab397 | /* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file tunnelbridge.h Header file for things common for tunnels and bridges */
#ifndef TUNNELBRIDGE_H
#define TUNNELBRIDGE_H
#include "map_func.h"
/**
* Calculates the length of a tunnel or a bridge (without end tiles)
* @return length of bridge/tunnel middle
*/
static inline uint GetTunnelBridgeLength(TileIndex begin, TileIndex end)
{
int x1 = TileX(begin);
int y1 = TileY(begin);
int x2 = TileX(end);
int y2 = TileY(end);
return abs(x2 + y2 - x1 - y1) - 1;
}
extern TileIndex _build_tunnel_endtile;
#endif /* TUNNELBRIDGE_H */
|