src/bridge_map.cpp
branchNewGRF_ports
changeset 6871 5a9dc001e1ad
parent 6743 cabfaa4a0295
child 6872 1c4a4a609f85
equal deleted inserted replaced
6870:ca3fd1fbe311 6871:5a9dc001e1ad
     5 #include "stdafx.h"
     5 #include "stdafx.h"
     6 #include "openttd.h"
     6 #include "openttd.h"
     7 #include "bridge_map.h"
     7 #include "bridge_map.h"
     8 #include "bridge.h"
     8 #include "bridge.h"
     9 #include "variables.h"
     9 #include "variables.h"
       
    10 #include "landscape.h"
    10 
    11 
    11 
    12 
    12 TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
    13 TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
    13 {
    14 {
    14 	TileIndexDiff delta = TileOffsByDiagDir(dir);
    15 	TileIndexDiff delta = TileOffsByDiagDir(dir);
    44 {
    45 {
    45 	uint h;
    46 	uint h;
    46 	Slope tileh = GetTileSlope(t, &h);
    47 	Slope tileh = GetTileSlope(t, &h);
    47 	Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
    48 	Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
    48 
    49 
    49 	/* one height level extra if the ramp is on a flat foundation */
    50 	/* one height level extra for the ramp */
    50 	return
    51 	return h + TILE_HEIGHT + ApplyFoundationToSlope(f, &tileh);
    51 		h + TILE_HEIGHT +
       
    52 		(IsLeveledFoundation(f) ? TILE_HEIGHT : 0) +
       
    53 		(IsSteepSlope(tileh) ? TILE_HEIGHT : 0);
       
    54 }
    52 }