[IW4MVM] Make sure to reset the timescale
This commit is contained in:
parent
1d6b340af3
commit
32789b29cf
@ -118,6 +118,14 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
void Dvar::Var::setRaw(float value)
|
||||
{
|
||||
if (this->dvar)
|
||||
{
|
||||
this->dvar->current.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
template<> static Dvar::Var Dvar::Register(const char* name, bool value, Dvar::Flag flag, const char* description)
|
||||
{
|
||||
return Game::Dvar_RegisterBool(name, value, flag.val, description);
|
||||
|
@ -34,6 +34,7 @@ namespace Components
|
||||
|
||||
// TODO: Add others
|
||||
void setRaw(int integer);
|
||||
void setRaw(float value);
|
||||
|
||||
private:
|
||||
Game::dvar_t* dvar;
|
||||
|
@ -13,6 +13,13 @@ namespace Components
|
||||
|
||||
client_main::Init();
|
||||
Scheduler::Once(client_main::PostInit);
|
||||
Scheduler::OnFrame([]()
|
||||
{
|
||||
if (!Game::CL_IsCgameInitialized())
|
||||
{
|
||||
Dvar::Var("com_timescale").setRaw(1.0f);
|
||||
}
|
||||
});
|
||||
|
||||
VirtualProtect(module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user