From 37b374cb92e0a73d5dd97262d8b5a12471380714 Mon Sep 17 00:00:00 2001 From: Desour Date: Tue, 11 Jul 2023 00:00:00 +0200 Subject: [PATCH] Use irr_ptr for Game::clouds --- src/client/game.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client/game.cpp b/src/client/game.cpp index 6e01f2ffe..95f67c3a5 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -893,7 +893,7 @@ private: GUIChatConsole *gui_chat_console = nullptr; // Free using ->Drop() MapDrawControl *draw_control = nullptr; Camera *camera = nullptr; - Clouds *clouds = nullptr; // Free using ->Drop() + irr_ptr clouds; Sky *sky = nullptr; // Free using ->Drop() Hud *hud = nullptr; Minimap *mapper = nullptr; @@ -1263,8 +1263,7 @@ void Game::shutdown() if (m_shutdown_progress == 0.0f) showOverlayMessage(N_("Shutting down..."), 0, 0); - if (clouds) - clouds->drop(); + clouds.reset(); if (gui_chat_console) gui_chat_console->drop(); @@ -1524,7 +1523,7 @@ bool Game::createClient(const GameStartData &start_data) /* Clouds */ if (m_cache_enable_clouds) - clouds = new Clouds(smgr, shader_src, -1, rand()); + clouds = make_irr(smgr, shader_src, -1, rand()); /* Skybox */