Skip to content

Commit

Permalink
Revert "Remember last used rotation for rides with no tracks."
Browse files Browse the repository at this point in the history
This reverts commit 7dc6e4e.
This commit caused hacked rides (like rollercoasters set to Crooked House) to crash
  • Loading branch information
Gymnasiast committed Oct 12, 2017
1 parent 6d29fd5 commit 202244e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/openrct2/ride/ride.c
Expand Up @@ -637,13 +637,8 @@ bool track_block_get_next(rct_xy_element *input, rct_xy_element *output, sint32
OriginZ -= trackBlock->z;
OriginZ += trackCoordinate->z_end;

// Prevent direction always falling back to 0 if ride has no tracks.
uint8 directionStart = (uint8)(direction ? *direction : 0);
if(ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK))
{
directionStart = ((trackCoordinate->rotation_end + rotation) & MAP_ELEMENT_DIRECTION_MASK) |
(trackCoordinate->rotation_end & (1 << 2));
}
uint8 directionStart = ((trackCoordinate->rotation_end + rotation) & MAP_ELEMENT_DIRECTION_MASK) |
(trackCoordinate->rotation_end & (1 << 2));

return track_block_get_next_from_zero(x, y, OriginZ, rideIndex, directionStart, output, z, direction);
}
Expand Down Expand Up @@ -1952,6 +1947,8 @@ sint32 ride_initialise_construction_window(sint32 rideIndex)

_previousTrackBankEnd = 0;
_previousTrackSlopeEnd = 0;

_currentTrackPieceDirection = 0;
_rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE;
_currentTrackSelectionFlags = 0;
_rideConstructionArrowPulseTime = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/openrct2/windows/RideConstruction.cpp
Expand Up @@ -611,6 +611,8 @@ rct_window *window_ride_construction_open()

_previousTrackBankEnd = 0;
_previousTrackSlopeEnd = 0;

_currentTrackPieceDirection = 0;
_rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE;
_currentTrackSelectionFlags = 0;
_rideConstructionArrowPulseTime = 0;
Expand Down

0 comments on commit 202244e

Please sign in to comment.