1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Fix #1972, #11679: Vehicles passing by toilets can cause them to glitch

This commit is contained in:
mix
2025-02-15 17:02:56 +00:00
committed by GitHub
parent c4c230b43b
commit 5fc55a0009
2 changed files with 9 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
0.4.20 (in development)
------------------------------------------------------------------------
- Improved: [#23677] Building new ride track now inherits the colour scheme from the previous piece.
- Fix: [#1972, #11679] Vehicles passing by toilets can cause them to glitch.
- Fix: [#9999, #10000, #10001, #10002, #10003] Truncated scenario strings when using Catalan, Czech, Japanese, Polish or Russian.
- Fix: [#16357] Chairlift station covers draw incorrectly.
- Fix: [#21768] Dirty blocks debug overlay is rendered incorrectly on high DPI screens.

View File

@@ -42,11 +42,10 @@ static void PaintFacility(
if (firstCarEntry == nullptr)
return;
auto lengthX = (direction & 1) == 0 ? 28 : 2;
auto lengthY = (direction & 1) == 0 ? 2 : 28;
CoordsXYZ offset(0, 0, height);
BoundBoxXYZ bb = { { direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height },
{ lengthX, lengthY, trackElement.GetClearanceZ() - trackElement.GetBaseZ() - 3 } };
const auto lengthZ = trackElement.GetClearanceZ() - trackElement.GetBaseZ() - 3;
const CoordsXYZ offset(0, 0, height);
const BoundBoxXYZ bb = (direction == 0 || direction == 3) ? BoundBoxXYZ{ { 2, 2, height + lengthZ }, { 28, 28, 1 } }
: BoundBoxXYZ{ { 2, 2, height }, { 28, 8, lengthZ } };
auto imageTemplate = session.TrackColours;
auto imageIndex = firstCarEntry->base_image_id + ((direction + 2) & 3);
@@ -57,21 +56,21 @@ static void PaintFacility(
auto foundationImageIndex = (direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS;
auto foundationImageId = foundationImageTemplate.WithIndex(foundationImageIndex);
PaintAddImageAsParent(session, foundationImageId, offset, bb);
PaintAddImageAsChild(session, imageId, offset, bb);
PaintAddImageAsChildRotated(session, direction, imageId, offset, bb);
}
else
{
PaintAddImageAsParent(session, imageId, offset, bb);
PaintAddImageAsParentRotated(session, direction, imageId, offset, bb);
}
// Base image if door was drawn
if (direction == 1)
{
PaintAddImageAsParent(session, imageId.WithIndexOffset(2), offset, { { 28, 2, height }, { 2, 28, 29 } });
PaintAddImageAsParent(session, imageId.WithIndexOffset(2), offset, { { 2, 2, height + lengthZ }, { 28, 28, 1 } });
}
else if (direction == 2)
{
PaintAddImageAsParent(session, imageId.WithIndexOffset(4), offset, { { 2, 28, height }, { 28, 2, 29 } });
PaintAddImageAsParent(session, imageId.WithIndexOffset(4), offset, { { 2, 2, height + lengthZ }, { 28, 28, 1 } });
}
PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0);