Codechange: Add constant for INVALID_WIDGET. (#14649)

Replaces direct use of -1, making it easier to find.
This commit is contained in:
Peter Nelson
2025-09-21 22:47:04 +01:00
committed by dP
parent 18bf0e2b58
commit 1824e42246
19 changed files with 35 additions and 44 deletions

View File

@@ -103,7 +103,7 @@ static TileIndex GetOtherAqueductEnd(TileIndex tile_from, TileIndex *tile_to = n
/** Toolbar window for constructing water infrastructure. */
struct BuildDocksToolbarWindow : Window {
DockToolbarWidgets last_clicked_widget = WID_DT_INVALID; ///< Contains the last widget that has been clicked on this toolbar.
WidgetID last_clicked_widget = INVALID_WIDGET; ///< Contains the last widget that has been clicked on this toolbar.
BuildDocksToolbarWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
{
@@ -198,7 +198,7 @@ struct BuildDocksToolbarWindow : Window {
default: return;
}
this->last_clicked_widget = (DockToolbarWidgets)widget;
this->last_clicked_widget = widget;
}
void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override