Skip to content

Commit

Permalink
Fix OpenRCT2#9324: crash trying to remove invalid footpath scenery.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZehMatt committed May 29, 2019
1 parent 4d7c78f commit faab83b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/openrct2/actions/FootpathSceneryRemoveAction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ DEFINE_GAME_ACTION(FootpathSceneryRemoveAction, GAME_COMMAND_REMOVE_FOOTPATH_SCE
}

auto tileElement = map_get_footpath_element(_loc.x / 32, _loc.y / 32, _loc.z / 8);
auto pathElement = tileElement->AsPath();
if (tileElement == nullptr)
{
log_error("Could not find path element.");
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_THIS);
}

auto pathElement = tileElement->AsPath();
if (pathElement == nullptr)
{
log_error("Could not find path element.");
Expand Down

0 comments on commit faab83b

Please sign in to comment.