diff --git a/src/Components/Modules/Dedicated.cpp b/src/Components/Modules/Dedicated.cpp index abef25a0..fe94db8c 100644 --- a/src/Components/Modules/Dedicated.cpp +++ b/src/Components/Modules/Dedicated.cpp @@ -244,7 +244,7 @@ namespace Components Dedicated::FrameSignal.connect(callback); } - void Dedicated::FrameStub() + void Dedicated::FrameHandler() { auto copy = Dedicated::FrameSignal; copy(); @@ -252,8 +252,19 @@ namespace Components copy = Dedicated::FrameOnceSignal; Dedicated::FrameOnceSignal.clear(); copy(); + } - Utils::Hook::Call(0x5A8E80)(); + __declspec(naked) void Dedicated::FrameStub() + { + __asm + { + pushad + call Dedicated::FrameHandler + popad + + push 5A8E80h + retn + } } Dedicated::Dedicated() diff --git a/src/Components/Modules/Dedicated.hpp b/src/Components/Modules/Dedicated.hpp index 696e3307..38fd8fb1 100644 --- a/src/Components/Modules/Dedicated.hpp +++ b/src/Components/Modules/Dedicated.hpp @@ -26,6 +26,7 @@ namespace Components static bool SendChat; static void MapRotate(); + static void FrameHandler(); static void FrameStub(); static void InitDedicatedServer(); diff --git a/src/Components/Modules/Network.cpp b/src/Components/Modules/Network.cpp index 5d3a7368..9496fd85 100644 --- a/src/Components/Modules/Network.cpp +++ b/src/Components/Modules/Network.cpp @@ -326,7 +326,7 @@ namespace Components // increase max port binding attempts from 10 to 100 Utils::Hook::Set(0x4FD48A, 100); - // increase cl_maxpackets limit to 120 + // increase cl_maxpackets limit Utils::Hook::Set(0x4050A1, 125); // Parse port as short in Net_AddrToString diff --git a/src/Components/Modules/Slowmotion.cpp b/src/Components/Modules/Slowmotion.cpp index a3911b18..7b4293a1 100644 --- a/src/Components/Modules/Slowmotion.cpp +++ b/src/Components/Modules/Slowmotion.cpp @@ -68,7 +68,7 @@ namespace Components SlowMotion::Delay = delay; // set snapshot num to 1 behind (T6 does this, why shouldn't we?) - for (int i = 0; i < *Game::svs_numclients; i++) + for (int i = 0; i < *Game::svs_numclients; ++i) { Game::svs_clients[i].snapNum = (*reinterpret_cast(0x31D9384)) - 1; } @@ -76,10 +76,11 @@ namespace Components SlowMotion::SlowMotion() { - if (!Dedicated::IsEnabled()) return; - - SlowMotion::Delay = 0; - Utils::Hook(0x5F5FF2, SlowMotion::SetSlowMotion, HOOK_JUMP).install()->quick(); - Utils::Hook(0x60B38A, SlowMotion::ApplySlowMotionStub, HOOK_CALL).install()->quick(); + if (Dedicated::IsEnabled()) + { + SlowMotion::Delay = 0; + Utils::Hook(0x5F5FF2, SlowMotion::SetSlowMotion, HOOK_JUMP).install()->quick(); + Utils::Hook(0x60B38A, SlowMotion::ApplySlowMotionStub, HOOK_CALL).install()->quick(); + } } }