1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 23:04:36 +01:00

Implement footpathplace

This commit is contained in:
duncanspumpkin
2019-03-01 12:57:58 +00:00
parent 510d71ab68
commit c8fd5174ae
5 changed files with 458 additions and 17 deletions

View File

@@ -156,7 +156,7 @@ TileElement* map_get_footpath_element(int32_t x, int32_t y, int32_t z)
return nullptr;
}
static TileElement* map_get_footpath_element_slope(int32_t x, int32_t y, int32_t z, int32_t slope)
PathElement* map_get_footpath_element_slope(int32_t x, int32_t y, int32_t z, int32_t slope)
{
TileElement* tileElement;
bool isSloped = slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED;
@@ -168,7 +168,7 @@ static TileElement* map_get_footpath_element_slope(int32_t x, int32_t y, int32_t
&& (tileElement->AsPath()->IsSloped() == isSloped)
&& (tileElement->AsPath()->GetSlopeDirection() == (slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK)))
{
return tileElement;
return tileElement->AsPath();
}
} while (!(tileElement++)->IsLastForTile());
@@ -424,7 +424,7 @@ static money32 footpath_place_real(
}
footpath_provisional_remove();
tileElement = map_get_footpath_element_slope((x / 32), (y / 32), z, slope);
tileElement = (TileElement*)map_get_footpath_element_slope((x / 32), (y / 32), z, slope);
if (tileElement == nullptr)
{
return footpath_element_insert(type, x, y, z, slope, flags, pathItemType);