1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-20 00:25:20 +01:00

Use unique_ptr for trivial ownership (#16300)

This commit is contained in:
Lucas OH
2025-07-03 17:32:46 +02:00
committed by GitHub
parent 08bc036311
commit 5b37614d23
10 changed files with 44 additions and 59 deletions

View File

@@ -236,7 +236,7 @@ public:
const GUIInventoryList::ItemSpec *getSelectedItem() const
{
return m_selected_item;
return m_selected_item.get();
}
u16 getSelectedAmount() const
@@ -346,7 +346,7 @@ protected:
std::vector<gui::IGUIElement *> m_clickthrough_elements;
std::vector<std::pair<std::string, GUIScrollContainer *>> m_scroll_containers;
GUIInventoryList::ItemSpec *m_selected_item = nullptr;
std::unique_ptr<GUIInventoryList::ItemSpec> m_selected_item;
u16 m_selected_amount = 0;
bool m_selected_dragging = false;
ItemStack m_selected_swap;