1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix FootpathRemoveAction crashing with invalid coordinates.

This commit is contained in:
Matt
2019-02-17 09:50:10 +01:00
parent 2d78eace05
commit 5f02c480c2

View File

@@ -62,6 +62,11 @@ public:
}
TileElement* footpathElement = GetFootpathElement();
if (footpathElement == nullptr)
{
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_FOOTPATH_FROM_HERE);
}
res->Cost = GetRefundPrice(footpathElement);
return res;
@@ -90,6 +95,10 @@ public:
tile_element_remove(footpathElement);
footpath_update_queue_chains();
}
else
{
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_FOOTPATH_FROM_HERE);
}
res->Cost = GetRefundPrice(footpathElement);