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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user