diff --git a/src/openrct2/actions/BannerPlaceAction.hpp b/src/openrct2/actions/BannerPlaceAction.hpp index 3892953103..08dd5aefe3 100644 --- a/src/openrct2/actions/BannerPlaceAction.hpp +++ b/src/openrct2/actions/BannerPlaceAction.hpp @@ -60,7 +60,7 @@ public: return MakeResult(GA_ERROR::NO_FREE_ELEMENTS, STR_CANT_POSITION_THIS_HERE); } - if (!map_is_location_valid({ _loc.x, _loc.y })) + if (!map_is_location_valid(_loc)) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_POSITION_THIS_HERE); } @@ -72,7 +72,7 @@ public: return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_BUILT_ACROSS_PATHS); } - if (!map_can_build_at({ _loc.x, _loc.y, _loc.z })) + if (!map_can_build_at(_loc)) { return MakeResult(GA_ERROR::NOT_OWNED, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } diff --git a/src/openrct2/actions/BannerSetStyleAction.hpp b/src/openrct2/actions/BannerSetStyleAction.hpp index 5159ead642..20de246531 100644 --- a/src/openrct2/actions/BannerSetStyleAction.hpp +++ b/src/openrct2/actions/BannerSetStyleAction.hpp @@ -68,7 +68,7 @@ public: res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING; res->Position.x = banner->position.x * 32 + 16; res->Position.y = banner->position.y * 32 + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); TileElement* tileElement = banner_get_tile_element(_bannerIndex); @@ -118,7 +118,7 @@ public: res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING; res->Position.x = banner->position.x * 32 + 16; res->Position.y = banner->position.y * 32 + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); TileElement* tileElement = banner_get_tile_element(_bannerIndex); diff --git a/src/openrct2/actions/FootpathPlaceAction.hpp b/src/openrct2/actions/FootpathPlaceAction.hpp index 5cf26051f5..0474cbfc25 100644 --- a/src/openrct2/actions/FootpathPlaceAction.hpp +++ b/src/openrct2/actions/FootpathPlaceAction.hpp @@ -63,7 +63,7 @@ public: gFootpathGroundFlags = 0; - if (map_is_edge({ _loc.x, _loc.y })) + if (map_is_edge(_loc)) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP); } @@ -251,7 +251,7 @@ private: return MakeResult(GA_ERROR::DISALLOWED, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } - auto surfaceElement = map_get_surface_element_at({ _loc.x, _loc.y }); + auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_BUILD_FOOTPATH_HERE); @@ -312,7 +312,7 @@ private: gFootpathGroundFlags = gMapGroundFlags; - auto surfaceElement = map_get_surface_element_at({ _loc.x, _loc.y }); + auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_BUILD_FOOTPATH_HERE); diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.hpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.hpp index 37b333ea3f..3dfa853b1e 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.hpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.hpp @@ -63,7 +63,7 @@ public: gFootpathGroundFlags = 0; - if (map_is_edge({ _loc.x, _loc.y })) + if (map_is_edge(_loc)) { return MakeResult( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); @@ -163,7 +163,7 @@ private: GA_ERROR::DISALLOWED, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } - auto surfaceElement = map_get_surface_element_at({ _loc.x, _loc.y }); + auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); @@ -226,7 +226,7 @@ private: gFootpathGroundFlags = gMapGroundFlags; - auto surfaceElement = map_get_surface_element_at({ _loc.x, _loc.y }); + auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); diff --git a/src/openrct2/actions/FootpathSceneryPlaceAction.hpp b/src/openrct2/actions/FootpathSceneryPlaceAction.hpp index 122c387b0d..3ded7310ae 100644 --- a/src/openrct2/actions/FootpathSceneryPlaceAction.hpp +++ b/src/openrct2/actions/FootpathSceneryPlaceAction.hpp @@ -53,7 +53,7 @@ public: auto res = MakeResult(); res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING; res->Position = _loc; - if (!map_is_location_valid({ _loc.x, _loc.y })) + if (!map_is_location_valid(_loc)) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } diff --git a/src/openrct2/actions/FootpathSceneryRemoveAction.hpp b/src/openrct2/actions/FootpathSceneryRemoveAction.hpp index 02752e9014..3d19cfbc75 100644 --- a/src/openrct2/actions/FootpathSceneryRemoveAction.hpp +++ b/src/openrct2/actions/FootpathSceneryRemoveAction.hpp @@ -47,7 +47,7 @@ public: GameActionResult::Ptr Query() const override { - if (!map_is_location_valid({ _loc.x, _loc.y })) + if (!map_is_location_valid(_loc)) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } diff --git a/src/openrct2/actions/LandBuyRightsAction.hpp b/src/openrct2/actions/LandBuyRightsAction.hpp index f6d6e0f7db..42c88d6c3a 100644 --- a/src/openrct2/actions/LandBuyRightsAction.hpp +++ b/src/openrct2/actions/LandBuyRightsAction.hpp @@ -93,7 +93,7 @@ private: CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16, (validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 }; - centre.z = tile_element_height({ centre.x, centre.y }); + centre.z = tile_element_height(centre); res->Position = centre; res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE; diff --git a/src/openrct2/actions/LandSetRightsAction.hpp b/src/openrct2/actions/LandSetRightsAction.hpp index 9b088b62c4..8ff958e642 100644 --- a/src/openrct2/actions/LandSetRightsAction.hpp +++ b/src/openrct2/actions/LandSetRightsAction.hpp @@ -97,7 +97,7 @@ private: CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16, (validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 }; - centre.z = tile_element_height({ centre.x, centre.y }); + centre.z = tile_element_height(centre); res->Position = centre; res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE; diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.hpp b/src/openrct2/actions/LargeSceneryPlaceAction.hpp index 9441994568..a768191d92 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.hpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.hpp @@ -89,7 +89,7 @@ public: auto res = std::make_unique(); res->ErrorTitle = STR_CANT_POSITION_THIS_HERE; res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING; - int16_t surfaceHeight = tile_element_height({ _loc.x, _loc.y }); + int16_t surfaceHeight = tile_element_height(_loc); res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; res->Position.z = surfaceHeight; @@ -214,7 +214,7 @@ public: auto res = std::make_unique(); res->ErrorTitle = STR_CANT_POSITION_THIS_HERE; - int16_t surfaceHeight = tile_element_height({ _loc.x, _loc.y }); + int16_t surfaceHeight = tile_element_height(_loc); res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; res->Position.z = surfaceHeight; @@ -369,7 +369,7 @@ private: continue; } - auto* surfaceElement = map_get_surface_element_at({ curTile.x, curTile.y }); + auto* surfaceElement = map_get_surface_element_at(curTile); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.hpp b/src/openrct2/actions/LargeSceneryRemoveAction.hpp index 3c3afc4551..d459023c5f 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.hpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.hpp @@ -56,7 +56,7 @@ public: const uint32_t flags = GetFlags(); - int32_t z = tile_element_height({ _loc.x, _loc.x }); + int32_t z = tile_element_height(_loc); res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; res->Position.z = z; @@ -126,7 +126,7 @@ public: const uint32_t flags = GetFlags(); - int32_t z = tile_element_height({ _loc.x, _loc.y }); + int32_t z = tile_element_height(_loc); res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; res->Position.z = z; diff --git a/src/openrct2/actions/LargeScenerySetColourAction.hpp b/src/openrct2/actions/LargeScenerySetColourAction.hpp index 7d627b94a9..03ad61bd44 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.hpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.hpp @@ -62,7 +62,7 @@ private: res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING; res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; - res->Position.z = tile_element_height({ _loc.x, _loc.y }); + res->Position.z = tile_element_height(_loc); res->ErrorTitle = STR_CANT_REPAINT_THIS; if (_loc.x < 0 || _loc.y < 0 || _loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY) diff --git a/src/openrct2/actions/MazeSetTrackAction.hpp b/src/openrct2/actions/MazeSetTrackAction.hpp index 222ab75341..8fb7444601 100644 --- a/src/openrct2/actions/MazeSetTrackAction.hpp +++ b/src/openrct2/actions/MazeSetTrackAction.hpp @@ -101,7 +101,7 @@ public: return res; } - auto surfaceElement = map_get_surface_element_at(_loc.x / 32, _loc.y / 32); + auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { res->Error = GA_ERROR::UNKNOWN; diff --git a/src/openrct2/actions/PlacePeepSpawnAction.hpp b/src/openrct2/actions/PlacePeepSpawnAction.hpp index 7fbe902df2..f94d8c1e15 100644 --- a/src/openrct2/actions/PlacePeepSpawnAction.hpp +++ b/src/openrct2/actions/PlacePeepSpawnAction.hpp @@ -80,7 +80,7 @@ public: } // Verify location is unowned - auto surfaceMapElement = map_get_surface_element_at(_location.x >> 5, _location.y >> 5); + auto surfaceMapElement = map_get_surface_element_at(_location); if (surfaceMapElement == nullptr) { return std::make_unique(GA_ERROR::UNKNOWN, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE); diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp index 91644811ef..94a470e304 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp @@ -129,7 +129,7 @@ public: auto res = MakeResult(); res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; - res->Position.z = tile_element_height({ _loc.x, _loc.y }); + res->Position.z = tile_element_height(_loc); res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION; return res; } @@ -189,7 +189,7 @@ public: auto res = MakeResult(); res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; - res->Position.z = tile_element_height({ _loc.x, _loc.y }); + res->Position.z = tile_element_height(_loc); res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION; TileElement* tileElement = tile_element_insert({ _loc.x / 32, _loc.y / 32, z / 8 }, 0b1111); @@ -272,7 +272,7 @@ public: auto res = MakeResult(); res->Position.x = loc.x + 16; res->Position.y = loc.y + 16; - res->Position.z = tile_element_height({ loc.x, loc.y }); + res->Position.z = tile_element_height(loc); res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION; return res; } diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.hpp b/src/openrct2/actions/RideEntranceExitRemoveAction.hpp index afb96657b0..22c9b07dac 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.hpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.hpp @@ -168,7 +168,7 @@ public: auto res = MakeResult(); res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); footpath_queue_chain_reset(); maze_entrance_hedge_replacement(_loc.x, _loc.y, tileElement); diff --git a/src/openrct2/actions/RideSetAppearanceAction.hpp b/src/openrct2/actions/RideSetAppearanceAction.hpp index dd61205250..c54a994cc8 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.hpp +++ b/src/openrct2/actions/RideSetAppearanceAction.hpp @@ -163,7 +163,7 @@ public: { res->Position.x = ride->overall_view.x * 32 + 16; res->Position.y = ride->overall_view.y * 32 + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); } return res; diff --git a/src/openrct2/actions/RideSetName.hpp b/src/openrct2/actions/RideSetName.hpp index 104568d25b..a4cb2e6bcb 100644 --- a/src/openrct2/actions/RideSetName.hpp +++ b/src/openrct2/actions/RideSetName.hpp @@ -97,7 +97,7 @@ public: auto res = std::make_unique(); res->Position.x = ride->overall_view.x * 32 + 16; res->Position.y = ride->overall_view.y * 32 + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); return res; } diff --git a/src/openrct2/actions/RideSetPriceAction.hpp b/src/openrct2/actions/RideSetPriceAction.hpp index 81438e5c47..cc21feef32 100644 --- a/src/openrct2/actions/RideSetPriceAction.hpp +++ b/src/openrct2/actions/RideSetPriceAction.hpp @@ -97,7 +97,7 @@ public: { res->Position.x = ride->overall_view.x * 32 + 16; res->Position.y = ride->overall_view.y * 32 + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); } uint32_t shopItem; diff --git a/src/openrct2/actions/RideSetSetting.hpp b/src/openrct2/actions/RideSetSetting.hpp index 271f743470..d59323d078 100644 --- a/src/openrct2/actions/RideSetSetting.hpp +++ b/src/openrct2/actions/RideSetSetting.hpp @@ -246,7 +246,7 @@ public: { res->Position.x = ride->overall_view.x * 32 + 16; res->Position.y = ride->overall_view.y * 32 + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); } window_invalidate_by_number(WC_RIDE, _rideIndex); return res; diff --git a/src/openrct2/actions/RideSetStatus.hpp b/src/openrct2/actions/RideSetStatus.hpp index c67c354afd..8743a19184 100644 --- a/src/openrct2/actions/RideSetStatus.hpp +++ b/src/openrct2/actions/RideSetStatus.hpp @@ -124,7 +124,7 @@ public: { res->Position.x = ride->overall_view.x * 32 + 16; res->Position.y = ride->overall_view.y * 32 + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); } switch (_status) diff --git a/src/openrct2/actions/RideSetVehiclesAction.hpp b/src/openrct2/actions/RideSetVehiclesAction.hpp index ec0d0e3de6..a05b0ced49 100644 --- a/src/openrct2/actions/RideSetVehiclesAction.hpp +++ b/src/openrct2/actions/RideSetVehiclesAction.hpp @@ -205,7 +205,7 @@ public: { res->Position.x = ride->overall_view.x * 32 + 16; res->Position.y = ride->overall_view.y * 32 + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); } auto intent = Intent(INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE); diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.hpp b/src/openrct2/actions/SmallSceneryPlaceAction.hpp index b5d047a654..97ed65375d 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.hpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.hpp @@ -99,8 +99,8 @@ public: { supportsRequired = true; } - int32_t landHeight = tile_element_height({ _loc.x, _loc.y }); - int16_t waterHeight = tile_element_water_height({ _loc.x, _loc.y }); + int32_t landHeight = tile_element_height(_loc); + int16_t waterHeight = tile_element_water_height(_loc); int32_t surfaceHeight = landHeight; // If on water @@ -185,7 +185,7 @@ public: return std::make_unique(GA_ERROR::NOT_OWNED, STR_LAND_NOT_OWNED_BY_PARK); } - auto* surfaceElement = map_get_surface_element_at({ _loc.x, _loc.y }); + auto* surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement != nullptr && !gCheatsDisableClearanceChecks && surfaceElement->GetWaterHeight() > 0) { @@ -302,8 +302,8 @@ public: { supportsRequired = true; } - int32_t landHeight = tile_element_height({ _loc.x, _loc.y }); - int16_t waterHeight = tile_element_water_height({ _loc.x, _loc.y }); + int32_t landHeight = tile_element_height(_loc); + int16_t waterHeight = tile_element_water_height(_loc); int32_t surfaceHeight = landHeight; // If on water diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.hpp b/src/openrct2/actions/SmallSceneryRemoveAction.hpp index 9019208fc2..0b2c47b86a 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.hpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.hpp @@ -56,7 +56,7 @@ public: { GameActionResult::Ptr res = std::make_unique(); - if (!map_is_location_valid({ _loc.x, _loc.y })) + if (!map_is_location_valid(_loc)) { return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } @@ -124,7 +124,7 @@ public: return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); map_invalidate_tile_full(_loc.x, _loc.y); tile_element_remove(tileElement); diff --git a/src/openrct2/actions/TileModifyAction.hpp b/src/openrct2/actions/TileModifyAction.hpp index b5308a916e..80b1914366 100644 --- a/src/openrct2/actions/TileModifyAction.hpp +++ b/src/openrct2/actions/TileModifyAction.hpp @@ -255,7 +255,7 @@ private: res->Position.x = _loc.x; res->Position.y = _loc.y; - res->Position.z = tile_element_height({ _loc.x, _loc.y }); + res->Position.z = tile_element_height(_loc); return res; } diff --git a/src/openrct2/actions/TrackPlaceAction.hpp b/src/openrct2/actions/TrackPlaceAction.hpp index 83479da9eb..2682277fa8 100644 --- a/src/openrct2/actions/TrackPlaceAction.hpp +++ b/src/openrct2/actions/TrackPlaceAction.hpp @@ -308,7 +308,7 @@ public: if ((rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) && !byte_9D8150) { - auto surfaceElement = map_get_surface_element_at({ mapLoc.x, mapLoc.y }); + auto surfaceElement = map_get_surface_element_at(mapLoc); uint8_t waterHeight = surfaceElement->GetWaterHeight() * 2; if (waterHeight == 0) @@ -350,7 +350,7 @@ public: } // 6c5648 12 push - auto surfaceElement = map_get_surface_element_at({ mapLoc.x, mapLoc.y }); + auto surfaceElement = map_get_surface_element_at(mapLoc); if (!gCheatsDisableSupportLimits) { int32_t ride_height = clearanceZ - surfaceElement->base_height; @@ -505,7 +505,7 @@ public: res->GroundFlags = mapGroundFlags; // 6c5648 12 push - auto surfaceElement = map_get_surface_element_at({ mapLoc.x, mapLoc.y }); + auto surfaceElement = map_get_surface_element_at(mapLoc); int32_t supportHeight = baseZ - surfaceElement->base_height; if (supportHeight < 0) @@ -672,7 +672,7 @@ public: if (rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) { - auto* waterSurfaceElement = map_get_surface_element_at({ mapLoc.x, mapLoc.y }); + auto* waterSurfaceElement = map_get_surface_element_at(mapLoc); waterSurfaceElement->SetHasTrackThatNeedsWater(true); tileElement = reinterpret_cast(waterSurfaceElement); } diff --git a/src/openrct2/actions/TrackRemoveAction.hpp b/src/openrct2/actions/TrackRemoveAction.hpp index 505e51eb04..5cd51c3a84 100644 --- a/src/openrct2/actions/TrackRemoveAction.hpp +++ b/src/openrct2/actions/TrackRemoveAction.hpp @@ -216,7 +216,7 @@ public: } } - auto* surfaceElement = map_get_surface_element_at({ mapLoc.x, mapLoc.y }); + auto* surfaceElement = map_get_surface_element_at(mapLoc); if (surfaceElement == nullptr) { log_warning("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); @@ -411,7 +411,7 @@ public: } } - auto* surfaceElement = map_get_surface_element_at({ mapLoc.x, mapLoc.y }); + auto* surfaceElement = map_get_surface_element_at(mapLoc); if (surfaceElement == nullptr) { log_warning("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); diff --git a/src/openrct2/actions/WallPlaceAction.hpp b/src/openrct2/actions/WallPlaceAction.hpp index 3390f1d4da..424a75f0cf 100644 --- a/src/openrct2/actions/WallPlaceAction.hpp +++ b/src/openrct2/actions/WallPlaceAction.hpp @@ -109,7 +109,7 @@ public: if (_loc.z == 0) { - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_PATH_SCENERY) @@ -142,7 +142,7 @@ public: auto targetHeight = _loc.z; if (targetHeight == 0) { - auto* surfaceElement = map_get_surface_element_at({ _loc.x, _loc.y }); + auto* surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); @@ -159,7 +159,7 @@ public: } } - auto* surfaceElement = map_get_surface_element_at({ _loc.x, _loc.y }); + auto* surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); @@ -309,14 +309,14 @@ public: if (res->Position.z == 0) { - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); } uint8_t edgeSlope = 0; auto targetHeight = _loc.z; if (targetHeight == 0) { - auto* surfaceElement = map_get_surface_element_at({ _loc.x, _loc.y }); + auto* surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); diff --git a/src/openrct2/actions/WallRemoveAction.hpp b/src/openrct2/actions/WallRemoveAction.hpp index 9fff1fa160..993e88bd60 100644 --- a/src/openrct2/actions/WallRemoveAction.hpp +++ b/src/openrct2/actions/WallRemoveAction.hpp @@ -44,7 +44,7 @@ public: res->Cost = 0; res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING; - if (!map_is_location_valid({ _loc.x, _loc.y })) + if (!map_is_location_valid(_loc)) { return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); @@ -84,7 +84,7 @@ public: res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; - res->Position.z = tile_element_height({ res->Position.x, res->Position.y }); + res->Position.z = tile_element_height(res->Position); tile_element_remove_banner_entry(wallElement); map_invalidate_tile_zoom1(_loc.x, _loc.y, wallElement->base_height * 8, (wallElement->base_height * 8) + 72); diff --git a/src/openrct2/actions/WaterLowerAction.hpp b/src/openrct2/actions/WaterLowerAction.hpp index 050c3bd29c..807a1f10cd 100644 --- a/src/openrct2/actions/WaterLowerAction.hpp +++ b/src/openrct2/actions/WaterLowerAction.hpp @@ -63,8 +63,8 @@ private: res->Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16; res->Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16; - int16_t z = tile_element_height({ res->Position.x, res->Position.y }); - int16_t waterHeight = tile_element_water_height({ res->Position.x, res->Position.y }); + int16_t z = tile_element_height(res->Position); + int16_t waterHeight = tile_element_water_height(res->Position); if (waterHeight != 0) { z = waterHeight; diff --git a/src/openrct2/actions/WaterRaiseAction.hpp b/src/openrct2/actions/WaterRaiseAction.hpp index e896aeb535..3acc5445e7 100644 --- a/src/openrct2/actions/WaterRaiseAction.hpp +++ b/src/openrct2/actions/WaterRaiseAction.hpp @@ -64,8 +64,8 @@ private: res->Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16; res->Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16; - int32_t z = tile_element_height({ res->Position.x, res->Position.y }); - int16_t waterHeight = tile_element_water_height({ res->Position.x, res->Position.y }); + int32_t z = tile_element_height(res->Position); + int16_t waterHeight = tile_element_water_height(res->Position); if (waterHeight != 0) { z = waterHeight; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 8de2e83be8..d25b41a2c0 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -723,9 +723,9 @@ bool map_can_build_at(CoordsXYZ loc) bool map_is_location_owned(CoordsXYZ loc) { // This check is to avoid throwing lots of messages in logs. - if (map_is_location_valid({ loc.x, loc.y })) + if (map_is_location_valid(loc)) { - auto* surfaceElement = map_get_surface_element_at({ loc.x, loc.y }); + auto* surfaceElement = map_get_surface_element_at(loc); if (surfaceElement != nullptr) { if (surfaceElement->GetOwnership() & OWNERSHIP_OWNED)