diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index ddef9ec113..a76427c852 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -370,7 +370,7 @@ bool GraphicsSet::FillSetDetails(const IniFile &ini, const std::string &path, co GRFConfig &GraphicsSet::GetOrCreateExtraConfig() const { if (!this->extra_cfg) { - this->extra_cfg.reset(new GRFConfig(this->files[GFT_EXTRA].filename)); + this->extra_cfg = std::make_unique(this->files[GFT_EXTRA].filename); /* We know the palette of the base set, so if the base NewGRF is not * setting one, use the palette of the base set and not the global diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index 97ec944d80..1c8bf4fa37 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -521,7 +521,7 @@ void AddGRFTextToList(GRFTextList &list, uint8_t langid, uint32_t grfid, bool al */ void AddGRFTextToList(GRFTextWrapper &list, uint8_t langid, uint32_t grfid, bool allow_newlines, std::string_view text_to_add) { - if (!list) list.reset(new GRFTextList()); + if (list == nullptr) list = std::make_shared(); AddGRFTextToList(*list, langid, grfid, allow_newlines, text_to_add); } @@ -533,7 +533,7 @@ void AddGRFTextToList(GRFTextWrapper &list, uint8_t langid, uint32_t grfid, bool */ void AddGRFTextToList(GRFTextWrapper &list, std::string_view text_to_add) { - if (!list) list.reset(new GRFTextList()); + if (list == nullptr) list = std::make_shared(); AddGRFTextToList(*list, GRFLX_UNSPECIFIED, text_to_add); } diff --git a/src/sound.cpp b/src/sound.cpp index 2e51d31b26..95d11b1474 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -37,7 +37,7 @@ static void OpenBankFile(const std::string &filename) /* If there is no sound file (nosound set), don't load anything */ if (filename.empty()) return; - original_sound_file.reset(new RandomAccessFile(filename, BASESET_DIR)); + original_sound_file = std::make_unique(filename, BASESET_DIR); size_t pos = original_sound_file->GetPos(); uint count = original_sound_file->ReadDword();