Unlock max fps on mp

This commit is contained in:
FutureRave 2022-03-22 21:30:44 +00:00
parent 6635218dce
commit 7b5933fa25
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955
3 changed files with 16 additions and 0 deletions

View File

@ -15,6 +15,8 @@ namespace game
Dvar_RegisterBool_t Dvar_RegisterBool; Dvar_RegisterBool_t Dvar_RegisterBool;
Dvar_RegisterInt_t Dvar_RegisterInt;
Dvar_RegisterFloat_t Dvar_RegisterFloat; Dvar_RegisterFloat_t Dvar_RegisterFloat;
Dvar_SetIntByName_t Dvar_SetIntByName; Dvar_SetIntByName_t Dvar_SetIntByName;
@ -626,6 +628,8 @@ namespace game
native::Dvar_RegisterBool = native::Dvar_RegisterBool_t(SELECT_VALUE(0x4914D0, 0x5BE9F0, 0x0)); native::Dvar_RegisterBool = native::Dvar_RegisterBool_t(SELECT_VALUE(0x4914D0, 0x5BE9F0, 0x0));
native::Dvar_RegisterInt = native::Dvar_RegisterInt_t(SELECT_VALUE(0x48CD40, 0x5BEA40, 0x0));
native::Dvar_RegisterFloat = native::Dvar_RegisterFloat_t(SELECT_VALUE(0x4F9CC0, 0x5BEA80, 0x0)); native::Dvar_RegisterFloat = native::Dvar_RegisterFloat_t(SELECT_VALUE(0x4F9CC0, 0x5BEA80, 0x0));
native::Dvar_SetIntByName = native::Dvar_SetIntByName_t(SELECT_VALUE(0x5396B0, 0x5BF560, 0x0)); native::Dvar_SetIntByName = native::Dvar_SetIntByName_t(SELECT_VALUE(0x5396B0, 0x5BF560, 0x0));

View File

@ -27,6 +27,10 @@ namespace game
unsigned __int16 flags, const char* description); unsigned __int16 flags, const char* description);
extern Dvar_RegisterBool_t Dvar_RegisterBool; extern Dvar_RegisterBool_t Dvar_RegisterBool;
typedef const dvar_t* (*Dvar_RegisterInt_t)(const char* dvarName, int value,
int min, int max, unsigned __int16 flags, const char* description);
extern Dvar_RegisterInt_t Dvar_RegisterInt;
typedef const dvar_t* (*Dvar_RegisterFloat_t)(const char* dvarName, float value, typedef const dvar_t* (*Dvar_RegisterFloat_t)(const char* dvarName, float value,
float min, float max, unsigned __int16 flags, const char* description); float min, float max, unsigned __int16 flags, const char* description);
extern Dvar_RegisterFloat_t Dvar_RegisterFloat; extern Dvar_RegisterFloat_t Dvar_RegisterFloat;

View File

@ -40,6 +40,8 @@ private:
void patch_mp() const void patch_mp() const
{ {
// Note: on SP it's already unlocked to 1000
utils::hook(0x55411F, &dvar_register_com_max_fps, HOOK_CALL).install()->quick();
} }
void patch_dedi() const void patch_dedi() const
@ -56,6 +58,12 @@ private:
longjmp(buf, value); longjmp(buf, value);
} }
static const game::native::dvar_t* dvar_register_com_max_fps(const char* dvarName, int value,
int min, int /*max*/, unsigned __int16 flags, const char* description)
{
return game::native::Dvar_RegisterInt(dvarName, value, min, 1000, flags, description);
}
}; };
REGISTER_MODULE(patches) REGISTER_MODULE(patches)