mirror of https://github.com/OpenRCT2/OpenRCT2.git
Directly call MapCanConstructWithClearAt()
This commit is contained in:
parent
15fcbf5463
commit
2da64715cc
|
@ -313,14 +313,14 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions::
|
||||||
uint8_t crossingMode = (_type & FOOTPATH_ELEMENT_INSERT_QUEUE) || (_slope != TILE_ELEMENT_SLOPE_FLAT)
|
uint8_t crossingMode = (_type & FOOTPATH_ELEMENT_INSERT_QUEUE) || (_slope != TILE_ELEMENT_SLOPE_FLAT)
|
||||||
? CREATE_CROSSING_MODE_NONE
|
? CREATE_CROSSING_MODE_NONE
|
||||||
: CREATE_CROSSING_MODE_PATH_OVER_TRACK;
|
: CREATE_CROSSING_MODE_PATH_OVER_TRACK;
|
||||||
if (!entrancePath
|
auto canBuild = MapCanConstructWithClearAt(
|
||||||
&& !map_can_construct_with_clear_at(
|
{ _loc, zLow, zHigh }, &map_place_non_scenery_clear_func, quarterTile, GAME_COMMAND_FLAG_APPLY | GetFlags(),
|
||||||
{ _loc, zLow, zHigh }, &map_place_non_scenery_clear_func, quarterTile, GAME_COMMAND_FLAG_APPLY | GetFlags(),
|
crossingMode);
|
||||||
&res->Cost, crossingMode))
|
if (!entrancePath && canBuild->Error != GameActions::Status::Ok)
|
||||||
{
|
{
|
||||||
return MakeResult(
|
return canBuild;
|
||||||
GameActions::Status::NoClearance, STR_CANT_BUILD_FOOTPATH_HERE, gGameCommandErrorText, gCommonFormatArgs);
|
|
||||||
}
|
}
|
||||||
|
res->Cost += canBuild->Cost;
|
||||||
|
|
||||||
gFootpathGroundFlags = gMapGroundFlags;
|
gFootpathGroundFlags = gMapGroundFlags;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue