mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 21:43:06 +01:00
Make track_design_place_all_scenery() take a CoordsXYZ
This commit is contained in:
@@ -1267,7 +1267,7 @@ static bool TrackDesignPlaceSceneryElement(
|
||||
* rct2: 0x006D0964
|
||||
*/
|
||||
static int32_t track_design_place_all_scenery(
|
||||
const std::vector<TrackDesignSceneryElement>& sceneryList, int32_t originX, int32_t originY, int32_t originZ)
|
||||
const std::vector<TrackDesignSceneryElement>& sceneryList, const CoordsXYZ& origin)
|
||||
{
|
||||
for (uint8_t mode = 0; mode <= 1; mode++)
|
||||
{
|
||||
@@ -1284,14 +1284,14 @@ static int32_t track_design_place_all_scenery(
|
||||
for (const auto& scenery : sceneryList)
|
||||
{
|
||||
uint8_t rotation = _currentTrackPieceDirection;
|
||||
TileCoordsXY tileCoords = { originX / COORDS_XY_STEP, originY / COORDS_XY_STEP };
|
||||
TileCoordsXY tileCoords = TileCoordsXY(origin);
|
||||
TileCoordsXY offsets = { scenery.x, scenery.y };
|
||||
tileCoords += offsets.Rotate(rotation);
|
||||
|
||||
auto mapCoord = CoordsXYZ{ tileCoords.ToCoordsXY(), originZ };
|
||||
auto mapCoord = CoordsXYZ{ tileCoords.ToCoordsXY(), origin.z };
|
||||
track_design_update_max_min_coordinates(mapCoord);
|
||||
|
||||
if (!TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, originZ))
|
||||
if (!TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, origin.z))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1824,8 +1824,7 @@ int32_t place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc
|
||||
// Scenery elements
|
||||
if (track_place_success)
|
||||
{
|
||||
if (!track_design_place_all_scenery(
|
||||
td6->scenery_elements, _trackPreviewOrigin.x, _trackPreviewOrigin.y, _trackPreviewOrigin.z))
|
||||
if (!track_design_place_all_scenery(td6->scenery_elements, _trackPreviewOrigin))
|
||||
{
|
||||
return _trackDesignPlaceCost;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user