Prevent TI hotkey from setting wall slope for non-slopeable objects (#21635)

This commit is contained in:
Andrew 2024-03-22 06:20:48 -04:00 committed by GitHub
parent 51b0143b2d
commit 693c422cd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -7,6 +7,7 @@
- Fix: [#910] Extra viewport does not preserve the location when rotating.
- Fix: [#21434] Number of guests overflows in objective text.
- Fix: [#21543] Crash with creating a TrackIterator with invalid arguments.
- Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects.
- Fix: [#21641] Crash when creating track iterator from an invalid tile element.
0.4.9 (2024-03-02)

View File

@ -33,6 +33,7 @@
#include <openrct2/interface/Screenshot.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/network/network.h>
#include <openrct2/object/WallSceneryEntry.h>
#include <openrct2/platform/Platform.h>
#include <openrct2/ride/Track.h>
#include <openrct2/ride/TrackPaint.h>
@ -527,6 +528,12 @@ static void ShortcutToggleWallSlope()
return;
}
// Ensure a wall can be built on a slope
if (tileElement->AsWall()->GetEntry()->flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE)
{
return;
}
int32_t currSlopeValue = tileElement->AsWall()->GetSlope();
int32_t newSlopeValue = (currSlopeValue + 1) % 3;