1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Fix: #13397: Broken Stations with Simulate Mode

This commit is contained in:
kyphii
2023-04-22 13:41:26 -04:00
committed by GitHub
parent c88fe4d2d2
commit 9ca4e48c79
5 changed files with 8 additions and 6 deletions

View File

@@ -19,6 +19,7 @@
- Change: [OpenSFX#17] Update Hybrid RC lifthill loop.
- Fix: [#12598] Number of holes is not set correctly when saving track designs.
- Fix: [#13130] Android always defaulting to UK locale for language, currency and temperature.
- Fix: [#13397] Ride simulation causes strange station behaviour and makes the ride unusable in some cases
- Fix: [#16791] Rotodrop top piece replicates when walls are placed around it and clearance checks are disabled (original bug).
- Fix: [#18895] Responding mechanic blocked at level crossing.
- Fix: [#19231] Crash due to null pointer to previously deleted banner in tile copy/paste functionality

View File

@@ -622,9 +622,9 @@ GameActions::Result TrackPlaceAction::Execute() const
}
// If the placed tile is a station modify station properties.
// Don't do this if the ride is simulating and the tile is a ghost to prevent desyncs.
if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN
&& !(ride->status == RideStatus::Simulating && GetFlags() & GAME_COMMAND_FLAG_GHOST))
// Don't do this if the tile is a ghost to prevent desyncs
// However, ghost tiles from track designs need to modify station data to display properly
if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN && (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) || _fromTrackDesign))
{
if (trackBlock->index == 0)
{

View File

@@ -421,7 +421,7 @@ GameActions::Result TrackRemoveAction::Execute() const
// If the removed tile is a station modify station properties.
// Don't do this if the ride is simulating and the tile is a ghost to prevent desyncs.
if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN
&& !(ride->status == RideStatus::Simulating && tileElement->Flags & TILE_ELEMENT_FLAG_GHOST)
&& (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) || (GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN))
&& (tileElement->AsTrack()->GetSequenceIndex() == 0))
{
const auto removeElementResult = TrackRemoveStationElement(

View File

@@ -43,7 +43,7 @@
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "14"
#define NETWORK_STREAM_VERSION "15"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION

View File

@@ -1613,7 +1613,8 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi
auto trackRemoveAction = TrackRemoveAction(
trackType, 0, { newCoords, tempZ, static_cast<Direction>(rotation & 3) });
trackRemoveAction.SetFlags(
GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST);
GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST
| GAME_COMMAND_FLAG_TRACK_DESIGN);
GameActions::ExecuteNested(&trackRemoveAction);
break;
}