From 96b20484483e637f11abd8291efb74de9c58b738 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Sun, 14 May 2023 10:58:48 +0100 Subject: [PATCH] use noexcept function --- src/client/component/script.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/component/script.cpp b/src/client/component/script.cpp index d9df3339..10645dc4 100644 --- a/src/client/component/script.cpp +++ b/src/client/component/script.cpp @@ -82,11 +82,12 @@ namespace script const auto scripts = utils::io::list_files(script_dir); + std::error_code e; for (const auto& script : scripts) { std::string data; auto script_file = script.generic_string(); - if (!std::filesystem::is_directory(script) && utils::io::read_file(script_file, &data)) + if (!std::filesystem::is_directory(script, e) && utils::io::read_file(script_file, &data)) { if (data.size() >= sizeof(GSC_MAGIC) && !std::memcmp(data.data(), &GSC_MAGIC, sizeof(GSC_MAGIC))) { @@ -94,7 +95,7 @@ namespace script load_script(script_file, data); } } - else if (std::filesystem::is_directory(script)) + else if (std::filesystem::is_directory(script, e)) { load_scripts_folder(script_file); } @@ -153,7 +154,8 @@ namespace script return 1; } - void scr_loot_get_utem_quantity_stub(game::scriptInstance_t inst, game::scr_entref_t entref) + void scr_loot_get_utem_quantity_stub([[maybe_unused]] game::scriptInstance_t inst, + [[maybe_unused]] game::scr_entref_t entref) { game::Scr_AddInt(game::SCRIPTINSTANCE_SERVER, 255); }