From 15490010e1e71311a5ce5eff728bc2beb1c3e75e Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 23 Oct 2018 14:52:51 +0200 Subject: [PATCH] Revert "Fix #8064: Prohibited high construction error is sometimes shown as (undefined string)" This reverts commit a8e46f5eecf05bd6ba060561334be11a3ff58b1d. --- distribution/changelog.txt | 1 - src/openrct2/network/Network.cpp | 2 +- src/openrct2/ride/Track.cpp | 39 +++++++++++++++----------------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 569f9be402..c4449ff5fd 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -19,7 +19,6 @@ - Fix: [#8045] Crash when switching between languages. - Fix: [#8062] In multiplayer warnings for unstable cheats are shown when disabling them. - Fix: [#8090] Maze designs saved incorrectly. -- Fix: [#8064] Error about prohibited high construction is sometimes shown as (undefined string). - Fix: [#8101] Title sequences window flashes after opening. - Fix: [#8120] Crash trying to place peep spawn outside of map. - Improved: [#2940] Allow mouse-dragging to set patrol area (Singleplayer only). diff --git a/src/openrct2/network/Network.cpp b/src/openrct2/network/Network.cpp index 33370b51ba..de1b031619 100644 --- a/src/openrct2/network/Network.cpp +++ b/src/openrct2/network/Network.cpp @@ -28,7 +28,7 @@ // This string 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 "3" +#define NETWORK_STREAM_VERSION "2" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static rct_peep* _pickup_peep = nullptr; diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 11d333ba62..b7d4dbabc1 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -1077,8 +1077,23 @@ static money32 track_place( { return MONEY32_UNDEFINED; } - const uint16_t* trackFlags = (rideTypeFlags & RIDE_TYPE_FLAG_FLAT_RIDE) ? FlatTrackFlags : TrackFlags; + if (trackFlags[type] & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) + { + if ((originZ & 0x0F) != 8) + { + gGameCommandErrorText = STR_CONSTRUCTION_ERR_UNKNOWN; + return MONEY32_UNDEFINED; + } + } + else + { + if ((originZ & 0x0F) != 0) + { + gGameCommandErrorText = STR_CONSTRUCTION_ERR_UNKNOWN; + return MONEY32_UNDEFINED; + } + } // If that is not the case, then perform the remaining checks trackBlock = get_track_def_from_ride(ride, type); @@ -1129,6 +1144,7 @@ static money32 track_place( int32_t x = originX + offsetX; int32_t y = originY + offsetY; int32_t z = originZ + trackBlock->z; + trackpieceZ = z; if (z < 16) @@ -1167,26 +1183,7 @@ static money32 track_place( : CREATE_CROSSING_MODE_NONE; if (!map_can_construct_with_clear_at( x, y, baseZ, clearanceZ, &map_place_non_scenery_clear_func, bl, flags, &cost, crossingMode)) - { return MONEY32_UNDEFINED; - } - - if (trackFlags[type] & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) - { - if ((z & 0x0F) != 8) - { - gGameCommandErrorText = STR_CONSTRUCTION_ERR_UNKNOWN; - return MONEY32_UNDEFINED; - } - } - else - { - if ((z & 0x0F) != 0) - { - gGameCommandErrorText = STR_CONSTRUCTION_ERR_UNKNOWN; - return MONEY32_UNDEFINED; - } - } } // 6c53dc @@ -2369,4 +2366,4 @@ void TrackElement::SetHighlight(bool on) type &= ~TILE_ELEMENT_TYPE_FLAG_HIGHLIGHT; if (on) type |= TILE_ELEMENT_TYPE_FLAG_HIGHLIGHT; -} +} \ No newline at end of file