mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r23167) -Codechange [FS#4818]: make IsTunnelInWay z parameters signed as well (hackalittlebit)
This commit is contained in:
parent
aca5f7ccf5
commit
704dcc0a47
@ -45,10 +45,10 @@ TileIndex GetOtherTunnelEnd(TileIndex tile)
|
|||||||
* @param dir the direction to start searching to.
|
* @param dir the direction to start searching to.
|
||||||
* @return true if and only if there is a tunnel.
|
* @return true if and only if there is a tunnel.
|
||||||
*/
|
*/
|
||||||
bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir)
|
bool IsTunnelInWayDir(TileIndex tile, int z, DiagDirection dir)
|
||||||
{
|
{
|
||||||
TileIndexDiff delta = TileOffsByDiagDir(dir);
|
TileIndexDiff delta = TileOffsByDiagDir(dir);
|
||||||
uint height;
|
int height;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
tile -= delta;
|
tile -= delta;
|
||||||
@ -65,7 +65,7 @@ bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir)
|
|||||||
* @param z the 'z' to search on.
|
* @param z the 'z' to search on.
|
||||||
* @return true if and only if there is a tunnel.
|
* @return true if and only if there is a tunnel.
|
||||||
*/
|
*/
|
||||||
bool IsTunnelInWay(TileIndex tile, uint z)
|
bool IsTunnelInWay(TileIndex tile, int z)
|
||||||
{
|
{
|
||||||
return IsTunnelInWayDir(tile, z, (TileX(tile) > (MapMaxX() / 2)) ? DIAGDIR_NE : DIAGDIR_SW) ||
|
return IsTunnelInWayDir(tile, z, (TileX(tile) > (MapMaxX() / 2)) ? DIAGDIR_NE : DIAGDIR_SW) ||
|
||||||
IsTunnelInWayDir(tile, z, (TileY(tile) > (MapMaxY() / 2)) ? DIAGDIR_NW : DIAGDIR_SE);
|
IsTunnelInWayDir(tile, z, (TileY(tile) > (MapMaxY() / 2)) ? DIAGDIR_NW : DIAGDIR_SE);
|
||||||
|
@ -38,8 +38,8 @@ static inline bool IsTunnelTile(TileIndex t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TileIndex GetOtherTunnelEnd(TileIndex);
|
TileIndex GetOtherTunnelEnd(TileIndex);
|
||||||
bool IsTunnelInWay(TileIndex, uint z);
|
bool IsTunnelInWay(TileIndex, int z);
|
||||||
bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir);
|
bool IsTunnelInWayDir(TileIndex tile, int z, DiagDirection dir);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes a road tunnel entrance
|
* Makes a road tunnel entrance
|
||||||
|
Loading…
Reference in New Issue
Block a user