From d7845ec6907acee98fcbe69243ed6faf31dcb587 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 7 Jun 2024 21:57:39 +0200 Subject: [PATCH] fix: Build issues --- plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp | 4 ++-- plugins/script_loader/source/plugin_script_loader.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp b/plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp index f948ad61f..264a3d689 100644 --- a/plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp +++ b/plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp @@ -279,8 +279,8 @@ namespace hex::script::loader { } void DotNetLoader::clearScripts() { - std::erase_if(getScripts(), [](const Script *script) { - return !script->background; + std::erase_if(getScripts(), [](const Script &script) { + return !script.background; }); } diff --git a/plugins/script_loader/source/plugin_script_loader.cpp b/plugins/script_loader/source/plugin_script_loader.cpp index 085c53cfd..c6cf0b6f7 100644 --- a/plugins/script_loader/source/plugin_script_loader.cpp +++ b/plugins/script_loader/source/plugin_script_loader.cpp @@ -30,7 +30,7 @@ namespace { void loadScript(std::vector &scripts, auto &loader) { loader.loadAll(); - for (auto &script : loader.getScripts()) + for (auto &script : std::as_const(loader).getScripts()) scripts.emplace_back(&script); } @@ -106,7 +106,7 @@ namespace { } for (const auto &script : scripts) { - const auto &[name, background, entryPoint, loader] = *script; + const auto &[name, path, background, entryPoint, loader] = *script; if (background) continue;