1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 08:52:40 +01:00

Fix #13760: Store encoded error message inside CommandCost. (#13764)

Encoded error message was previously static to avoid memmory allocation, however this causes complications.
This commit is contained in:
Peter Nelson
2025-03-15 20:09:11 +00:00
committed by GitHub
parent 0cd87bc8c1
commit a87b804386
5 changed files with 9 additions and 12 deletions

View File

@@ -287,7 +287,7 @@ void UnshowCriticalError()
* @param y World Y position (TileVirtY) of the error location. Set both x and y to 0 to just center the message when there is no related error tile.
* @param cc CommandCost containing the optional detailed and extra error messages shown in the second and third lines (can be empty).
*/
void ShowErrorMessage(EncodedString &&summary_msg, int x, int y, const CommandCost &cc)
void ShowErrorMessage(EncodedString &&summary_msg, int x, int y, CommandCost &cc)
{
EncodedString error = std::move(cc.GetEncodedMessage());
if (error.empty()) error = GetEncodedStringIfValid(cc.GetErrorMessage());