Merge pull request #286 from diamante0018/generic-patch-13

Move static assert to the header file
This commit is contained in:
Edo 2022-05-29 10:26:50 +02:00 committed by GitHub
commit 2f00b24fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 23 deletions

View File

@ -168,17 +168,4 @@ namespace Components
got->second(&params);
}
}
Command::Command()
{
AssertSize(Game::cmd_function_t, 24);
Command::Add("openLink", [](Command::Params* params)
{
if (params->size() > 1)
{
Utils::OpenUrl(params->get(1));
}
});
}
}

View File

@ -5,6 +5,8 @@ namespace Components
class Command : public Component
{
public:
static_assert(sizeof(Game::cmd_function_t) == 0x18);
class Params
{
public:
@ -45,7 +47,7 @@ namespace Components
int nesting_;
};
Command();
Command() = default;
static Game::cmd_function_t* Allocate();

View File

@ -231,15 +231,6 @@ namespace Components
QuickPatch::QuickPatch()
{
// quitHard
Command::Add("quitHard", [](Command::Params*)
{
int data = false;
const Utils::Library ntdll("ntdll.dll");
ntdll.invokePascal<void>("RtlAdjustPrivilege", 19, true, false, &data);
ntdll.invokePascal<void>("NtRaiseHardError", 0xC000007B, 0, nullptr, nullptr, 6, &data);
});
// Filtering any mapents that is intended for Spec:Ops gamemode (CODO) and prevent them from spawning
Utils::Hook(0x5FBD6E, QuickPatch::IsDynClassnameStub, HOOK_CALL).install()->quick();