diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 244a35f0..840ec331 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,6 @@ jobs: uses: microsoft/setup-msbuild@v1.1.3 - name: Generate project files - #run: tools/premake5 vs2022 --ci-build run: tools/premake5 vs2022 - name: Set up problem matching diff --git a/premake5.lua b/premake5.lua index 1818c93c..724cf957 100644 --- a/premake5.lua +++ b/premake5.lua @@ -227,10 +227,12 @@ targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}" configurations {"Debug", "Release"} -architecture "x64" +language "C++" +cppdialect "C++20" + +architecture "x86_64" platforms "x64" -buildoptions "/std:c++latest" systemversion "latest" symbols "On" staticruntime "On" @@ -255,7 +257,7 @@ filter {} filter "configurations:Release" optimize "Size" buildoptions {"/GL"} - linkoptions { "/IGNORE:4702", "/LTCG" } + linkoptions {"/IGNORE:4702", "/LTCG"} defines {"NDEBUG"} flags {"FatalCompileWarnings"} filter {} diff --git a/src/client/component/filesystem.cpp b/src/client/component/filesystem.cpp index 1c5d8f00..46dcea4b 100644 --- a/src/client/component/filesystem.cpp +++ b/src/client/component/filesystem.cpp @@ -86,15 +86,11 @@ namespace filesystem bool can_insert_path(const std::filesystem::path& path) { - for (const auto& path_ : get_search_paths_internal()) + const auto& paths = get_search_paths_internal(); + return std::ranges::none_of(paths.cbegin(), paths.cend(), [path](const auto& elem) { - if (path_ == path) - { - return false; - } - } - - return true; + return elem == path; + }); } const char* sys_default_install_path_stub() diff --git a/src/client/component/gsc.cpp b/src/client/component/gsc.cpp index 36616409..435314e7 100644 --- a/src/client/component/gsc.cpp +++ b/src/client/component/gsc.cpp @@ -50,9 +50,9 @@ namespace gsc std::unordered_map functions; std::optional gsc_error; - char* allocate_buffer(size_t size) + char* allocate_buffer(std::uint32_t size) { - return utils::hook::invoke(0x14061E680, size, 4, 1, 5); + return static_cast(game::PMem_AllocFromSource_NoDebug(size, 4, 1, 5)); } bool read_scriptfile(const std::string& name, std::string* data) @@ -135,7 +135,7 @@ namespace gsc const auto script_size = script.size(); const auto buffer_size = script_size + stack.size() + 2; - const auto buffer = allocate_buffer(buffer_size); + const auto buffer = allocate_buffer(static_cast(buffer_size)); std::memcpy(buffer, script.data(), script_size); std::memcpy(&buffer[script_size], stack.data(), stack.size()); diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 84325c22..0a25474c 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -133,6 +133,8 @@ namespace game WEAK symbol Scr_ExecThread{0x1405C6F40}; WEAK symbol Scr_RegisterFunction{0x1405BC7B0}; + WEAK symbol PMem_AllocFromSource_NoDebug{0x14061E680}; + WEAK symbol VM_Execute{0x1405C8DB0}; WEAK symbol