1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

Fix 4389321623: Invalid string parameters in cheat window. (#13696)

Strings unnecessarily consumed an extra parameter, and change company use unformatted string.
This commit is contained in:
Peter Nelson
2025-03-02 09:02:14 +00:00
committed by GitHub
parent edf9f597ec
commit 321debf7b1
2 changed files with 6 additions and 6 deletions

View File

@@ -304,9 +304,9 @@ struct CheatWindow : Window {
/* Draw coloured flag for change company cheat */
case STR_CHEAT_CHANGE_COMPANY: {
uint offset = WidgetDimensions::scaled.hsep_indent + GetStringBoundingBox(ce->str).width;
DrawCompanyIcon(_local_company, rtl ? text_right - offset - WidgetDimensions::scaled.hsep_indent : text_left + offset, y + icon_y_offset);
str = GetString(ce->str, val + 1);
uint offset = WidgetDimensions::scaled.hsep_indent + GetStringBoundingBox(str).width;
DrawCompanyIcon(_local_company, rtl ? text_right - offset - WidgetDimensions::scaled.hsep_indent : text_left + offset, y + icon_y_offset);
break;
}