From d7b65d48ac1bde04dd7cd94c67540e7fe928d370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 23 May 2025 18:48:57 +0300 Subject: [PATCH 1/2] Fix potential bug with missing 0 terminator --- src/openrct2-ui/windows/LoadSave.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 778c044514..063460d4d2 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -960,7 +960,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_FILENAME_TEXTBOX: { - std::string tempText = text.data(); + std::string tempText{ text }; const char* cStr = tempText.c_str(); if (strcmp(_currentFilename, cStr) == 0) return; From e40d56ed762886b461de05740f49382344b7fa51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 23 May 2025 19:08:41 +0300 Subject: [PATCH 2/2] Avoid expensive copies calling ViewportSurfaceSmoothenEdge --- src/openrct2/paint/tile_element/Paint.Surface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index dbcc901255..5dac893ee7 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -380,7 +380,7 @@ static uint8_t ViewportSurfacePaintSetupGetRelativeSlope(const SurfaceElement& s * rct2: 0x0065E890, 0x0065E946, 0x0065E9FC, 0x0065EAB2 */ static void ViewportSurfaceSmoothenEdge( - PaintSession& session, enum edge_t edge, struct TileDescriptor self, struct TileDescriptor neighbour) + PaintSession& session, const edge_t edge, const TileDescriptor& self, const TileDescriptor& neighbour) { PROFILED_FUNCTION();