1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Fix #8248: Invalid tile element in footpath_element_insert (#8249)

* Fix #8248: Invalid tile element in footpath_element_insert

* Update Footpath.cpp
This commit is contained in:
Michał Janiszewski
2018-11-11 19:17:08 +01:00
committed by GitHub
parent 6deb5daf86
commit 7582afe0b4

View File

@@ -247,6 +247,11 @@ static money32 footpath_element_insert(
tileElement = map_get_surface_element_at({ x, y });
if (tileElement == nullptr)
{
return MONEY32_UNDEFINED;
}
int32_t supportHeight = z - tileElement->base_height;
gFootpathPrice += supportHeight < 0 ? MONEY(20, 00) : (supportHeight / 2) * MONEY(5, 00);