mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-19 02:12:37 +01:00
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:
@@ -114,7 +114,7 @@ class BuildObjectWindow : public PickerWindow {
|
||||
int info_height; ///< The height of the info box.
|
||||
|
||||
public:
|
||||
BuildObjectWindow(WindowDesc *desc, WindowNumber) : PickerWindow(desc, nullptr, 0, ObjectPickerCallbacks::instance), info_height(1)
|
||||
BuildObjectWindow(WindowDesc &desc, WindowNumber) : PickerWindow(desc, nullptr, 0, ObjectPickerCallbacks::instance), info_height(1)
|
||||
{
|
||||
ResetObjectToPlace();
|
||||
this->ConstructWindow();
|
||||
@@ -410,7 +410,7 @@ Window *ShowBuildObjectPicker()
|
||||
{
|
||||
/* Don't show the place object button when there are no objects to place. */
|
||||
if (ObjectPickerCallbacks::instance.IsActive()) {
|
||||
return AllocateWindowDescFront<BuildObjectWindow>(&_build_object_desc, 0);
|
||||
return AllocateWindowDescFront<BuildObjectWindow>(_build_object_desc, 0);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user