mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Fix regression from #21474 due to use-after-free bug
This commit is contained in:
@@ -51,9 +51,9 @@ void Banner::FormatTextTo(Formatter& ft, bool addColour) const
|
||||
if (addColour)
|
||||
{
|
||||
auto formatToken = FormatTokenFromTextColour(text_colour);
|
||||
auto tokenText = FormatTokenToStringWithBraces(formatToken);
|
||||
formattedTextBuffer = FormatTokenToStringWithBraces(formatToken);
|
||||
ft.Add<StringId>(STR_STRING_STRINGID);
|
||||
ft.Add<const char*>(tokenText.data());
|
||||
ft.Add<const char*>(formattedTextBuffer.data());
|
||||
}
|
||||
|
||||
FormatTextTo(ft);
|
||||
|
||||
@@ -36,6 +36,7 @@ struct Banner
|
||||
ObjectEntryIndex type = BANNER_NULL;
|
||||
uint8_t flags{};
|
||||
std::string text;
|
||||
mutable std::string formattedTextBuffer;
|
||||
uint8_t colour{};
|
||||
RideId ride_index{};
|
||||
uint8_t text_colour{};
|
||||
|
||||
Reference in New Issue
Block a user