Codechange: Remove redundant char buffer. (#10808)

This commit is contained in:
PeterN 2023-05-11 22:36:11 +01:00 committed by GitHub
parent ca31976da0
commit 7e3646cf46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -273,7 +273,6 @@ struct CheatWindow : Window {
default: {
int32 val = (int32)ReadValue(ce->variable, ce->type);
char buf[512];
/* Draw [<][>] boxes for settings of an integer-type */
DrawArrowButtons(button_left, y + button_y_offset, COLOUR_YELLOW, clicked - (i * 2), true, true);
@ -285,8 +284,7 @@ struct CheatWindow : Window {
/* Draw coloured flag for change company cheat */
case STR_CHEAT_CHANGE_COMPANY: {
SetDParam(0, val + 1);
GetString(buf, STR_CHEAT_CHANGE_COMPANY, lastof(buf));
uint offset = WidgetDimensions::scaled.hsep_indent + GetStringBoundingBox(buf).width;
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);
break;
}