mirror of https://github.com/OpenRCT2/OpenRCT2.git
Close #14903. Use map_is_edge
This commit is contained in:
parent
517935e580
commit
ae6657dcdc
|
@ -1579,7 +1579,7 @@ static void map_window_set_pixels(rct_window* w)
|
|||
|
||||
for (int32_t i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++)
|
||||
{
|
||||
if (x > 0 && y > 0 && x < gMapSizeUnits && y < gMapSizeUnits)
|
||||
if (!map_is_edge({ x, y }))
|
||||
{
|
||||
switch (w->selected_tab)
|
||||
{
|
||||
|
|
|
@ -183,7 +183,7 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const
|
|||
|
||||
res->GroundFlags = tempSceneryGroundFlags;
|
||||
|
||||
if (!LocationValid(curTile) || curTile.x >= gMapSizeUnits || curTile.y >= gMapSizeUnits)
|
||||
if (!LocationValid(curTile) || map_is_edge(curTile))
|
||||
{
|
||||
return std::make_unique<LargeSceneryPlaceActionResult>(GameActions::Status::Disallowed, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
|
|
@ -50,8 +50,7 @@ GameActions::Result::Ptr PlaceParkEntranceAction::Query() const
|
|||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
res->Position = { _loc.x, _loc.y, _loc.z };
|
||||
|
||||
if (!LocationValid(_loc) || _loc.x <= 32 || _loc.y <= 32 || _loc.x >= (gMapSizeUnits - 32)
|
||||
|| _loc.y >= (gMapSizeUnits - 32))
|
||||
if (!LocationValid(_loc) || map_is_edge(_loc))
|
||||
{
|
||||
return std::make_unique<GameActions::Result>(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_CLOSE_TO_EDGE_OF_MAP);
|
||||
|
|
|
@ -47,7 +47,7 @@ const int32_t SEGMENTS_ALL = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 |
|
|||
*/
|
||||
void tile_element_paint_setup(paint_session* session, const CoordsXY& mapCoords, bool isTrackPiecePreview)
|
||||
{
|
||||
if (mapCoords.x < gMapSizeUnits && mapCoords.y < gMapSizeUnits && mapCoords.x >= 32 && mapCoords.y >= 32)
|
||||
if (!map_is_edge(mapCoords))
|
||||
{
|
||||
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
|
||||
paint_util_force_set_general_support_height(session, -1, 0);
|
||||
|
|
|
@ -1322,7 +1322,7 @@ std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructWithClearAt(
|
|||
|
||||
res->GroundFlags = ELEMENT_IS_ABOVE_GROUND;
|
||||
bool canBuildCrossing = false;
|
||||
if (pos.x >= gMapSizeUnits || pos.y >= gMapSizeUnits || pos.x < 32 || pos.y < 32)
|
||||
if (map_is_edge(pos))
|
||||
{
|
||||
res->Error = GameActions::Status::InvalidParameters;
|
||||
res->ErrorMessage = STR_OFF_EDGE_OF_MAP;
|
||||
|
|
Loading…
Reference in New Issue