Skip to content

Commit

Permalink
general: update
Browse files Browse the repository at this point in the history
  • Loading branch information
diamante0018 committed Nov 6, 2022
1 parent 2991ee9 commit 8d09d63
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
uses: microsoft/[email protected]

- name: Generate project files
#run: tools/premake5 vs2022 --ci-build
run: tools/premake5 vs2022

- name: Set up problem matching
Expand Down
8 changes: 5 additions & 3 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {}
Expand Down
12 changes: 4 additions & 8 deletions src/client/component/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions src/client/component/gsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ namespace gsc
std::unordered_map<scripting::script_function, unsigned int> functions;
std::optional<std::string> gsc_error;

char* allocate_buffer(size_t size)
char* allocate_buffer(std::uint32_t size)
{
return utils::hook::invoke<char*>(0x14061E680, size, 4, 1, 5);
return static_cast<char*>(game::PMem_AllocFromSource_NoDebug(size, 4, 1, 5));
}

bool read_scriptfile(const std::string& name, std::string* data)
Expand Down Expand Up @@ -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<std::uint32_t>(buffer_size));
std::memcpy(buffer, script.data(), script_size);
std::memcpy(&buffer[script_size], stack.data(), stack.size());

Expand Down
2 changes: 2 additions & 0 deletions src/client/game/symbols.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ namespace game
WEAK symbol<unsigned int(int handle, unsigned int paramcount)> Scr_ExecThread{0x1405C6F40};
WEAK symbol<unsigned int(void* func, int type, unsigned int name)> Scr_RegisterFunction{0x1405BC7B0};

WEAK symbol<void*(unsigned int size, unsigned int alignment, unsigned int type, int source)> PMem_AllocFromSource_NoDebug{0x14061E680};

WEAK symbol<unsigned int(unsigned int localId, const char* pos, unsigned int paramcount)> VM_Execute{0x1405C8DB0};

WEAK symbol<void(float x, float y, float width, float height, float s0, float t0, float s1, float t1,
Expand Down
Binary file modified tools/premake5.exe
Binary file not shown.
Binary file modified tools/protoc.exe
Binary file not shown.

0 comments on commit 8d09d63

Please sign in to comment.