Codechange: Pass WindowDesc by reference instead of pointer. (#12771)

WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
This commit is contained in:
Peter Nelson
2024-06-11 08:58:03 +01:00
committed by GitHub
parent 18bce69623
commit 4cf6d1dd79
68 changed files with 293 additions and 301 deletions

View File

@@ -54,7 +54,7 @@ public:
* @param desc The description of the window.
* @param window_number The window number, in this case the waypoint's ID.
*/
WaypointWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
WaypointWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
{
this->wp = Waypoint::Get(window_number);
this->vt = (wp->string_id == STR_SV_STNAME_WAYPOINT) ? VEH_TRAIN : VEH_SHIP;
@@ -196,5 +196,5 @@ static WindowDesc _waypoint_view_desc(
*/
void ShowWaypointWindow(const Waypoint *wp)
{
AllocateWindowDescFront<WaypointWindow>(&_waypoint_view_desc, wp->index);
AllocateWindowDescFront<WaypointWindow>(_waypoint_view_desc, wp->index);
}