Fix #20543: Crash using show segments height from debug paint option. (#20561)

* Fix #20543: Crash using show segments height debug option

* Update changelog.txt
This commit is contained in:
Matthias Moninger 2023-07-05 10:05:53 +03:00 committed by GitHub
parent 7f76c05a64
commit 279a056125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -29,6 +29,7 @@
- Fix: [#20429] Error window tooltip not closing after 8 seconds.
- Fix: [#20456] Downward large half loops on flying coasters (fly-to-lie) are now correctly named.
- Fix: [#20484] Console caret not properly updated when using command history.
- Fix: [#20543] Crash using show segments height from debug paint options.
0.4.5 (2023-05-08)
------------------------------------------------------------------------

View File

@ -314,7 +314,7 @@ static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoor
for (std::size_t sx = 0; sx < std::size(segmentPositions[sy]); sx++)
{
uint16_t segmentHeight = session.SupportSegments[segmentPositions[sy][sx]].height;
auto imageColourFlats = ImageId(SPR_LAND_TOOL_SIZE_1).WithTransparency(FilterPaletteID::PaletteDarken3);
auto imageColourFlats = ImageId(SPR_LAND_TOOL_SIZE_1).WithTransparency(FilterPaletteID::PaletteGlassBlack);
if (segmentHeight == 0xFFFF)
{
segmentHeight = session.Support.height;
@ -329,13 +329,9 @@ static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoor
int32_t xOffset = static_cast<int32_t>(sy) * 10;
int32_t yOffset = -22 + static_cast<int32_t>(sx) * 10;
PaintStruct* ps = PaintAddImageAsParent(
PaintAddImageAsParent(
session, imageColourFlats, { xOffset, yOffset, segmentHeight },
{ { xOffset + 1, yOffset + 16, segmentHeight }, { 10, 10, 1 } });
if (ps != nullptr)
{
ps->image_id = ps->image_id.WithTertiary(COLOUR_BORDEAUX_RED);
}
}
}
}