1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Fix #18309: Vehicles glitch going inverted to uninverted with uncap fps (#24011)

This commit is contained in:
mix
2025-03-17 19:39:28 +00:00
committed by GitHub
parent 816984d58c
commit 647ab23c33
2 changed files with 12 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
- Fix: [#5281] Missing supports on miniature railways built backwards.
- Fix: [#10379] Banners outside the park can be renamed and modified (original bug).
- Fix: [#10582] Low clearance tunnels below water are drawn incorrectly (original bug).
- Fix: [#18309] Flying and Multi Dimension trains glitch when changing between inverted and uninverted track when uncap fps is on.
- Fix: [#23486] Object selection minimum requirements can be bypassed with close window hotkey.
- Fix: [#23743] Parks with guest goals over 32767 do not appear in the scenario list.
- Fix: [#23844] Sound effects keep playing when loading another save.

View File

@@ -26,6 +26,7 @@
#include "../core/Speed.hpp"
#include "../entity/EntityList.h"
#include "../entity/EntityRegistry.h"
#include "../entity/EntityTweener.h"
#include "../entity/Particle.h"
#include "../entity/Yaw.hpp"
#include "../interface/Viewport.h"
@@ -7004,6 +7005,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(
}
// Update VehicleFlags::CarIsInverted flag
const auto previousCarIsInverted = HasFlag(VehicleFlags::CarIsInverted);
ClearFlag(VehicleFlags::CarIsInverted);
{
auto rideType = ::GetRide(tileElement->AsTrack()->GetRideIndex())->type;
@@ -7014,6 +7016,10 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(
SetFlag(VehicleFlags::CarIsInverted);
}
}
if (previousCarIsInverted != HasFlag(VehicleFlags::CarIsInverted))
{
EntityTweener::Get().RemoveEntity(this);
}
}
}
@@ -7393,6 +7399,7 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(TrackElemType trackType, con
}
// Update VehicleFlags::CarIsInverted
const auto previousCarIsInverted = HasFlag(VehicleFlags::CarIsInverted);
ClearFlag(VehicleFlags::CarIsInverted);
if (GetRideTypeDescriptor(curRide.type).HasFlag(RtdFlag::hasInvertedVariant))
{
@@ -7400,6 +7407,10 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(TrackElemType trackType, con
{
SetFlag(VehicleFlags::CarIsInverted);
}
if (previousCarIsInverted != HasFlag(VehicleFlags::CarIsInverted))
{
EntityTweener::Get().RemoveEntity(this);
}
}
trackPos = { trackBeginEnd.begin_x, trackBeginEnd.begin_y, trackBeginEnd.begin_z };