[Slowmotion] Optimize killcam

This commit is contained in:
momo5502 2017-06-29 23:03:57 +02:00
parent 527f93803c
commit 1760741975
4 changed files with 24 additions and 5 deletions

View File

@ -54,6 +54,8 @@ namespace Components
Command::Execute("xstartprivatematch");
//Command::Execute("xstartlobby");
Command::Execute("sv_network_fps 1000");
Command::Execute("cl_maxpackets 125");
Command::Execute("snaps 30");
Command::Execute("com_maxfps 125");
// Process command line?

View File

@ -348,6 +348,13 @@ namespace Components
// increase cl_maxpackets limit
Utils::Hook::Set<BYTE>(0x4050A1, 125);
// increase snaps
//Utils::Hook::Set<BYTE>(0x405357, 40);
// default maxpackets and snaps
Utils::Hook::Set<BYTE>(0x40535B, 30);
Utils::Hook::Set<BYTE>(0x4050A5, 125);
// Parse port as short in Net_AddrToString
Utils::Hook::Set<char*>(0x4698E3, "%u.%u.%u.%u:%hu");

View File

@ -74,13 +74,21 @@ namespace Components
}
}
SlowMotion::SlowMotion()
void SlowMotion::DrawConnectionInterruptedStub(int a1)
{
if (Dedicated::IsEnabled())
if (!*reinterpret_cast<bool*>(0x1AD8ED0) && !*reinterpret_cast<bool*>(0x1AD8EEC) && !*reinterpret_cast<int*>(0x1AD78F8))
{
Utils::Hook::Call<void(int)>(0x454A70)(a1);
}
}
SlowMotion::SlowMotion()
{
SlowMotion::Delay = 0;
Utils::Hook(0x5F5FF2, SlowMotion::SetSlowMotion, HOOK_JUMP).install()->quick();
Utils::Hook(0x60B38A, SlowMotion::ApplySlowMotionStub, HOOK_CALL).install()->quick();
}
Utils::Hook(0x4A54ED, SlowMotion::DrawConnectionInterruptedStub, HOOK_CALL).install()->quick();
Utils::Hook(0x4A54FB, SlowMotion::DrawConnectionInterruptedStub, HOOK_CALL).install()->quick();
}
}

View File

@ -16,5 +16,7 @@ namespace Components
static void SetSlowMotion();
static void ApplySlowMotion(int timePassed);
static void ApplySlowMotionStub();
static void DrawConnectionInterruptedStub(int a1);
};
}