1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Merge pull request #14904 from duncanspumpkin/close_14903

Close #14903. Use map_is_edge
This commit is contained in:
Michael Steenbeek
2021-07-19 12:43:14 +02:00
committed by GitHub
4 changed files with 4 additions and 4 deletions

View File

@@ -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)
{

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;