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

This commit is contained in:
mix authored and GitHub committed 2025-06-10 20:35:43 +02:00
1 parent a65cb87315
commit 64e5602d60
2 files changed
+15 -12

No files matched your search

+2
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)
------------------------------------------------------------------------
+13 -12
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;