Fix #8064: Prohibited high construction error is sometimes shown as (undefined string)

This commit is contained in:
ζeh Matt 2018-10-21 20:51:41 +02:00 committed by Michael Steenbeek
parent 2802b9a5d3
commit a8e46f5eec
3 changed files with 23 additions and 19 deletions

View File

@ -19,6 +19,7 @@
- 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).

View File

@ -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 "2"
#define NETWORK_STREAM_VERSION "3"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static rct_peep* _pickup_peep = nullptr;

View File

@ -1077,23 +1077,8 @@ 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);
@ -1144,7 +1129,6 @@ 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)
@ -1183,7 +1167,26 @@ 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
@ -2366,4 +2369,4 @@ void TrackElement::SetHighlight(bool on)
type &= ~TILE_ELEMENT_TYPE_FLAG_HIGHLIGHT;
if (on)
type |= TILE_ELEMENT_TYPE_FLAG_HIGHLIGHT;
}
}