[Dvar]: Increase max value of dvar

This commit is contained in:
FutureRave 2023-02-18 12:18:41 +00:00
parent a588dea4b6
commit 311d6f7241
No known key found for this signature in database
GPG Key ID: 22F9079C86CFAB31
3 changed files with 10 additions and 1 deletions

View File

@ -250,6 +250,11 @@ namespace Components
return Game::Dvar_RegisterInt(dvarName, 1000, min, 1000, Game::DVAR_NONE, description);
}
const Game::dvar_t* Dvar::Dvar_RegisterPerkExtendedMeleeRange(const char* dvarName, float value, float min, float /*max*/, std::uint16_t flags, const char* description)
{
return Game::Dvar_RegisterFloat(dvarName, value, min, 10000.0f, flags, description);
}
void Dvar::SetFromStringByNameSafeExternal(const char* dvarName, const char* string)
{
static std::array<const char*, 8> exceptions =
@ -415,6 +420,9 @@ namespace Components
// Hook dvar 'sv_network_fps' registration
Utils::Hook(0x4D3C7B, Dvar_RegisterSVNetworkFps, HOOK_CALL).install()->quick();
// Hook dvar 'perk_extendedMeleeRange' and set a higher max, better than having people force this with external programs
Utils::Hook(0x492D2F, Dvar_RegisterPerkExtendedMeleeRange, HOOK_CALL).install()->quick();
// un-cheat safeArea_* and add archive flags
Utils::Hook::Xor<std::uint32_t>(0x42E3F5, Game::DVAR_ROM | Game::DVAR_ARCHIVE); //safeArea_adjusted_horizontal
Utils::Hook::Xor<std::uint32_t>(0x42E423, Game::DVAR_ROM | Game::DVAR_ARCHIVE); //safeArea_adjusted_vertical

View File

@ -42,6 +42,7 @@ namespace Components
static const Game::dvar_t* Dvar_RegisterName(const char* dvarName, const char* value, std::uint16_t flags, const char* description);
static const Game::dvar_t* Dvar_RegisterSVNetworkFps(const char* dvarName, int value, int min, int max, std::uint16_t flags, const char* description);
static const Game::dvar_t* Dvar_RegisterPerkExtendedMeleeRange(const char* dvarName, float value, float min, float max, std::uint16_t flags, const char* description);
static void SetFromStringByNameExternal(const char* dvarName, const char* string);
static void SetFromStringByNameSafeExternal(const char* dvarName, const char* string);

View File

@ -800,7 +800,7 @@ namespace Components
}, Scheduler::Pipeline::CLIENT, 10s);
});
if(Dedicated::IsEnabled())
if (Dedicated::IsEnabled())
{
Utils::Hook(0x4A7251, Maps::LoadNewMapCommand, HOOK_CALL).install()->quick();
}