1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 15:54:31 +01:00

Fix #20007: Wrong Error message when raising land or water: "Too low!" (#20123)

This commit is contained in:
Jochen Löppenberg
2023-05-06 14:23:17 +02:00
committed by GitHub
parent 21e15918a9
commit 8627a5875f
3 changed files with 19 additions and 4 deletions

View File

@@ -110,8 +110,16 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const
uint8_t currentSlope = surfaceElement->GetSlope();
uint8_t newSlope = tile_element_raise_styles[tableRow][currentSlope];
if (newSlope & SURFACE_STYLE_FLAG_RAISE_OR_LOWER_BASE_HEIGHT)
height += 2;
{
if (height + 2 > UINT8_MAX)
{
height = UINT8_MAX;
}
else
{
height += 2;
}
}
newSlope &= TILE_ELEMENT_SURFACE_SLOPE_MASK;
auto landSetHeightAction = LandSetHeightAction({ x, y }, height, newSlope);

View File

@@ -94,7 +94,14 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const
{
if (height > maxHeight)
continue;
height += 2;
if (height + 2 > UINT8_MAX)
{
height = UINT8_MAX;
}
else
{
height += 2;
}
}
else
{

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 "18"
#define NETWORK_STREAM_VERSION "19"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION