mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 18:31:59 -05:00
Merge pull request #7491 from martip23/CoveredRideHeightFix
Iterate and check for each element's height for cover. Fixes #7405
This commit is contained in:
commit
3c8a2ca55d
3 changed files with 14 additions and 2 deletions
|
@ -110,6 +110,7 @@ The following people are not part of the project team, but have been contributin
|
|||
* (Deurklink)
|
||||
* Nathan Zabriskie (NathanZabriskie)
|
||||
* Toby Hinloopen (tobyhinloopen)
|
||||
* Patrick Martinez (martip23)
|
||||
|
||||
## Toolchain
|
||||
* (Balletie) - macOS
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
- Fix: [#7327] Abstract scenery and stations don't get fully See-Through when hiding them (original bug).
|
||||
- Fix: [#7382] Opening the mini-map reverts the size of the land tool to 1x1, regardless of what was selected before.
|
||||
- Fix: [#7402] Edges of neigbouring footpaths stay connected after removing a path that's underneath a ride entrance.
|
||||
- Fix: [#7405] Rides can be covered by placing scenery underneath them.
|
||||
- Fix: [#7436] Only the first 32 vehicles of a train can be painted.
|
||||
- Fix: Cut-away view does not draw tile elements that have been moved down on the list.
|
||||
- Improved: [#2989] Multiplayer window now changes title when tab changes.
|
||||
|
|
|
@ -1819,9 +1819,10 @@ static void vehicle_update_measurements(rct_vehicle * vehicle)
|
|||
if (ride_get_entrance_location(ride, ride->current_test_station).isNull())
|
||||
return;
|
||||
|
||||
sint16 x, y;
|
||||
sint16 x, y, z;
|
||||
x = vehicle->x;
|
||||
y = vehicle->y;
|
||||
z = vehicle->z;
|
||||
|
||||
if (x == LOCATION_NULL)
|
||||
{
|
||||
|
@ -1830,12 +1831,20 @@ static void vehicle_update_measurements(rct_vehicle * vehicle)
|
|||
}
|
||||
|
||||
rct_tile_element * tile_element = map_get_surface_element_at({x, y});
|
||||
if (tile_element->base_height * 8 <= vehicle->z)
|
||||
// If vehicle above ground.
|
||||
if (tile_element->base_height * 8 <= z)
|
||||
{
|
||||
// Set tile_element to first element. Since elements aren't always ordered by base height,
|
||||
// we must start at the first element and iterate through each tile element.
|
||||
tile_element = map_get_first_element_at(x / 32, y / 32);
|
||||
|
||||
bool cover_found = false;
|
||||
do
|
||||
{
|
||||
// If the tile_element is lower than the vehicle, continue (don't set flag)
|
||||
if (tile_element->base_height * 8 <= z)
|
||||
continue;
|
||||
|
||||
if (tile_element->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY)
|
||||
{
|
||||
cover_found = true;
|
||||
|
@ -1857,6 +1866,7 @@ static void vehicle_update_measurements(rct_vehicle * vehicle)
|
|||
cover_found = true;
|
||||
break;
|
||||
}
|
||||
// Iterate through each tile_element.
|
||||
} while (!tile_element_is_last_for_tile(tile_element++));
|
||||
|
||||
if (cover_found == false)
|
||||
|
|
Loading…
Reference in a new issue