1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix right click ride construction bugs when ghost track on same tile

This commit is contained in:
mix
2025-06-10 19:35:43 +01:00
committed by GitHub
parent a65cb87315
commit 64e5602d60
2 changed files with 15 additions and 12 deletions

View File

@@ -3,6 +3,8 @@
- Feature: [#24411] Vanilla scenarios now also have previews in the scenario selection window.
- Change: [objects#383] Disable all base colours on non-remappable WWTT vehicles, change black to light_blue.
- Change: [objects#384] Remove erroneously enabled WWTT third remaps.
- Fix: [#15846] Rightclicking on track piece when there is construction below does not work.
- Fix: [#24576] It is possible to edit open rides in certain circumstances.
0.4.23 (2025-06-07)
------------------------------------------------------------------------

View File

@@ -986,13 +986,8 @@ bool RideModify(const CoordsXYE& input)
if (tileElement.element->GetType() == TileElementType::Entrance)
return ride_modify_entrance_or_exit(tileElement);
ride_create_or_find_construction_window(rideIndex);
const auto& rtd = ride->getRideTypeDescriptor();
if (rtd.specialType == RtdSpecialType::maze)
{
return ride_modify_maze(tileElement);
}
if (tileElement.element->GetType() != TileElementType::Track)
return false;
if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::cannotHaveGaps))
{
@@ -1001,12 +996,18 @@ bool RideModify(const CoordsXYE& input)
tileElement = endOfTrackElement;
}
if (tileElement.element == nullptr || tileElement.element->GetType() != TileElementType::Track)
return false;
const auto tileCoords = CoordsXYZ{ tileElement, tileElement.element->GetBaseZ() };
const auto direction = tileElement.element->GetDirection();
const auto type = tileElement.element->AsTrack()->GetTrackType();
ride_create_or_find_construction_window(rideIndex);
const auto& rtd = ride->getRideTypeDescriptor();
if (rtd.specialType == RtdSpecialType::maze)
{
return ride_modify_maze(tileElement);
}
auto tileCoords = CoordsXYZ{ tileElement, tileElement.element->GetBaseZ() };
auto direction = tileElement.element->GetDirection();
auto type = tileElement.element->AsTrack()->GetTrackType();
auto newCoords = GetTrackElementOriginAndApplyChanges({ tileCoords, direction }, type, 0, nullptr, {});
if (!newCoords.has_value())
return false;