1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Fix #16392: Scenery on sloped surface is placed at wrong height. (#17343)

* Fix #16392: Scenery on sloped surface is placed at wrong height.

* fix SceneryQuadrantOffset

* fix valley land height

* Bump network version

* update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
This commit is contained in:
Sadret
2022-07-20 21:33:33 +02:00
committed by GitHub
parent 2a58719284
commit ed18ef1146
7 changed files with 21 additions and 29 deletions

View File

@@ -68,9 +68,9 @@ set(OBJECTS_VERSION "1.3.2")
set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip")
set(OBJECTS_SHA1 "040a99a8626ad7a7f43f8c8a17c3f4e1375b218f")
set(REPLAYS_VERSION "0.0.67")
set(REPLAYS_VERSION "0.0.68")
set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip")
set(REPLAYS_SHA1 "0CA2DB3BEE021F0402D3E0F0E9EDB142CCEAFFC6")
set(REPLAYS_SHA1 "FC8EFE3FCA71F75D79728494ACC42DB49B18B529")
option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.")
option(WITH_TESTS "Build tests")

View File

@@ -4,6 +4,7 @@
- Feature: [#16662] Show a warning message when g2.dat is mismatched.
- Change: [#17319] Giant screenshots are now cropped to the horizontal view-clipping selection.
- Change: [#17499] Update error text when using vehicle incompatible with TD6 and add error when using incompatible track elements.
- Fix: [#16392] Scenery on sloped surface is placed at wrong height.
- Fix: [#16476] The game sometimes crashes when demolishing a maze.
- Fix: [#17444] “Manta Ray” boats slowed down too much in “Ayers Rock” scenario (original bug).
- Fix: [#17503] Parks with staff with an ID of 0 have all staff windows focus on that staff

View File

@@ -47,8 +47,8 @@
<TitleSequencesSha1>4ab0065e5a4d9f9c77d94718bbdfcfcd5a389da0</TitleSequencesSha1>
<ObjectsUrl>https://github.com/OpenRCT2/objects/releases/download/v1.3.2/objects.zip</ObjectsUrl>
<ObjectsSha1>040a99a8626ad7a7f43f8c8a17c3f4e1375b218f</ObjectsSha1>
<ReplaysUrl>https://github.com/OpenRCT2/replays/releases/download/v0.0.67/replays.zip</ReplaysUrl>
<ReplaysSha1>0CA2DB3BEE021F0402D3E0F0E9EDB142CCEAFFC6</ReplaysSha1>
<ReplaysUrl>https://github.com/OpenRCT2/replays/releases/download/v0.0.68/replays.zip</ReplaysUrl>
<ReplaysSha1>FC8EFE3FCA71F75D79728494ACC42DB49B18B529</ReplaysSha1>
</PropertyGroup>
<ItemGroup>

View File

@@ -135,8 +135,8 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
}
else
{
loc2.x += SceneryQuadrantOffsets[quadrant & 3].x - 1;
loc2.y += SceneryQuadrantOffsets[quadrant & 3].y - 1;
loc2.x += SceneryQuadrantOffsets[quadrant & 3].x;
loc2.y += SceneryQuadrantOffsets[quadrant & 3].y;
}
landHeight = tile_element_height(loc2);
waterHeight = tile_element_water_height(loc2);
@@ -329,8 +329,8 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const
}
else
{
x2 += SceneryQuadrantOffsets[quadrant & 3].x - 1;
y2 += SceneryQuadrantOffsets[quadrant & 3].y - 1;
x2 += SceneryQuadrantOffsets[quadrant & 3].x;
y2 += SceneryQuadrantOffsets[quadrant & 3].y;
}
landHeight = tile_element_height({ x2, y2 });
waterHeight = tile_element_water_height({ x2, y2 });

View File

@@ -42,7 +42,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 "1"
#define NETWORK_STREAM_VERSION "2"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static Peep* _pickup_peep = nullptr;

View File

@@ -527,7 +527,7 @@ int16_t tile_element_height(const CoordsXY& loc)
uint8_t xl, yl; // coordinates across this tile
uint8_t TILE_SIZE = 31;
uint8_t TILE_SIZE = 32;
xl = loc.x & 0x1f;
yl = loc.y & 0x1f;
@@ -569,14 +569,13 @@ int16_t tile_element_height(const CoordsXY& loc)
switch (slope)
{
case TILE_ELEMENT_SLOPE_NE_SIDE_UP:
height += xl / 2 + 1;
height += xl / 2;
break;
case TILE_ELEMENT_SLOPE_SE_SIDE_UP:
height += (TILE_SIZE - yl) / 2;
break;
case TILE_ELEMENT_SLOPE_NW_SIDE_UP:
height += yl / 2;
height++;
break;
case TILE_ELEMENT_SLOPE_SW_SIDE_UP:
height += (TILE_SIZE - xl) / 2;
@@ -595,7 +594,7 @@ int16_t tile_element_height(const CoordsXY& loc)
break;
case TILE_ELEMENT_SLOPE_S_CORNER_DN:
quad_extra = xl + yl;
quad = xl + yl - TILE_SIZE - 1;
quad = xl + yl - TILE_SIZE;
break;
case TILE_ELEMENT_SLOPE_E_CORNER_DN:
quad_extra = TILE_SIZE - xl + yl;
@@ -603,14 +602,13 @@ int16_t tile_element_height(const CoordsXY& loc)
break;
case TILE_ELEMENT_SLOPE_N_CORNER_DN:
quad_extra = (TILE_SIZE - xl) + (TILE_SIZE - yl);
quad = TILE_SIZE - yl - xl - 1;
quad = TILE_SIZE - yl - xl;
break;
}
if (extra_height)
{
height += quad_extra / 2;
height++;
return height;
}
// This tile is essentially at the next height level
@@ -628,20 +626,13 @@ int16_t tile_element_height(const CoordsXY& loc)
switch (slope)
{
case TILE_ELEMENT_SLOPE_W_E_VALLEY:
if (xl + yl <= TILE_SIZE + 1)
{
return height;
}
quad = TILE_SIZE - xl - yl;
quad = std::abs(xl - yl);
break;
case TILE_ELEMENT_SLOPE_N_S_VALLEY:
quad = xl - yl;
quad = std::abs(xl + yl - TILE_SIZE);
break;
}
if (quad > 0)
{
height += quad / 2;
}
height += quad / 2;
}
return height;

View File

@@ -59,10 +59,10 @@ static std::vector<ScenerySelection> _restrictedScenery;
// rct2: 0x009A3E74
const CoordsXY SceneryQuadrantOffsets[] = {
{ 7, 7 },
{ 7, 23 },
{ 23, 23 },
{ 23, 7 },
{ 8, 8 },
{ 8, 24 },
{ 24, 24 },
{ 24, 8 },
};
LargeSceneryText::LargeSceneryText(const rct_large_scenery_text& original)