From 3313590784842688068f8787edbd2a1511d34fe0 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 28 Jul 2017 10:56:04 +0200 Subject: [PATCH 1/3] Fix #6052: Unable to place entrance/exit on certain ride types. --- distribution/changelog.txt | 1 + src/openrct2/ride/track.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 429691286e..abc8878a32 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#5984] Allow socket binding to same port after crash - Fix: [#5998] Staff not getting paid / no loan interest. - Fix: [#6026] 'Select ride to advertise' dropdown does not display all items. +- Fix: [#6052] Unable to place entrance/exit on certain ride types. - Improved: [#4301] Leading and trailing whitespace in player name is now removed. - Improved: [#5859] OpenGL rendering performance - Improved: [#5863] Switching drawing engines no longer requires the application to restart. diff --git a/src/openrct2/ride/track.c b/src/openrct2/ride/track.c index 87a57c0bc1..7bbce30b58 100644 --- a/src/openrct2/ride/track.c +++ b/src/openrct2/ride/track.c @@ -1632,8 +1632,8 @@ static money32 track_remove(uint8 type, uint8 sequence, sint16 originX, sint16 o footpath_remove_edges_at(x, y, mapElement); } map_element_remove(mapElement); - sub_6CB945(rideIndex); - if (!(flags & (1 << 6))){ + if (!(flags & GAME_COMMAND_FLAG_GHOST)){ + sub_6CB945(rideIndex); ride_update_max_vehicles(rideIndex); } } From c4b3742bec012812ee4093624bdbb6455efc4b2f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 28 Jul 2017 11:11:12 +0200 Subject: [PATCH 2/3] Refactored constants to named flags. --- src/openrct2/ride/ride.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/openrct2/ride/ride.c b/src/openrct2/ride/ride.c index c194d75431..4bc53868fb 100644 --- a/src/openrct2/ride/ride.c +++ b/src/openrct2/ride/ride.c @@ -1400,10 +1400,11 @@ void ride_remove_provisional_track_piece() ride = get_ride(rideIndex); if (ride->type == RIDE_TYPE_MAZE) { - game_do_command(x , 41 | (0 << 8), y , rideIndex | (2 << 8), GAME_COMMAND_SET_MAZE_TRACK, z, 0); - game_do_command(x , 41 | (1 << 8), y + 16, rideIndex | (2 << 8), GAME_COMMAND_SET_MAZE_TRACK, z, 0); - game_do_command(x + 16, 41 | (2 << 8), y + 16, rideIndex | (2 << 8), GAME_COMMAND_SET_MAZE_TRACK, z, 0); - game_do_command(x + 16, 41 | (3 << 8), y , rideIndex | (2 << 8), GAME_COMMAND_SET_MAZE_TRACK, z, 0); + sint32 flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5; + game_do_command(x , flags | (0 << 8), y , rideIndex | (2 << 8), GAME_COMMAND_SET_MAZE_TRACK, z, 0); + game_do_command(x , flags | (1 << 8), y + 16, rideIndex | (2 << 8), GAME_COMMAND_SET_MAZE_TRACK, z, 0); + game_do_command(x + 16, flags | (2 << 8), y + 16, rideIndex | (2 << 8), GAME_COMMAND_SET_MAZE_TRACK, z, 0); + game_do_command(x + 16, flags | (3 << 8), y , rideIndex | (2 << 8), GAME_COMMAND_SET_MAZE_TRACK, z, 0); } else { direction = _unkF440C5.direction; if (!(direction & 4)) { @@ -1411,11 +1412,11 @@ void ride_remove_provisional_track_piece() y -= TileDirectionDelta[direction].y; } rct_xy_element next_track; - if (track_block_get_next_from_zero(x, y, z, rideIndex, direction, &next_track, &z, &direction)) { + sint32 flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_GHOST; game_do_command( next_track.x, - 105 | ((direction & 3) << 8), + flags | ((direction & 3) << 8), next_track.y, next_track.element->properties.track.type | (map_element_get_track_sequence(next_track.element) << 8), GAME_COMMAND_REMOVE_TRACK, From 6a85c49074c8457eaf274177d5687ae51d4f40dc Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 28 Jul 2017 11:22:55 +0200 Subject: [PATCH 3/3] Increment network version. --- src/openrct2/network/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 84f06ec665..5d825c0a36 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -55,7 +55,7 @@ extern "C" { // This define specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "12" +#define NETWORK_STREAM_VERSION "13" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION #ifdef __cplusplus