fix replicated dvars (#718)

* fix replicated dvars

* Consistent comments in patches

* Fix comments in ranked

Co-authored-by: Edo <edoardo.sanguineti222@gmail.com>
This commit is contained in:
m 2022-10-18 03:40:18 -05:00 committed by GitHub
parent aeaedbf92a
commit 6aa8f5da9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 10 deletions

View File

@ -316,7 +316,7 @@ namespace patches
//Use a relative jump to empty memory first
utils::hook::jump(SELECT_VALUE(0x1403B3A12, 0x1403F7582), SELECT_VALUE(cmd_exec_stub_sp, cmd_exec_stub_mp),
true);
//Use empty memory to go to our stub first (can't do close jump, so need space for 12 bytes)
// Use empty memory to go to our stub first (can't do close jump, so need space for 12 bytes)
// Fix mouse lag
utils::hook::nop(SELECT_VALUE(0x14043E6CB, 0x140504A2B), 6);
@ -351,7 +351,7 @@ namespace patches
// Patch SV_KickClientNum
sv_kick_client_num_hook.create(0x14046F730, &sv_kick_client_num);
// block changing name in-game
// Block changing name in-game
utils::hook::set<uint8_t>(0x140470300, 0xC3);
// Unlock all DLC items
@ -361,7 +361,7 @@ namespace patches
// Enable DLC items, extra loadouts and map selection in extinction
dvar_register_int_hook.create(0x1404EE270, &dvar_register_int);
// patch game chat on resolutions higher than 1080p to use the right font
// Patch game chat on resolutions higher than 1080p to use the right font
utils::hook::call(0x14025C825, get_chat_font_handle);
utils::hook::call(0x1402BC42F, get_chat_font_handle);
utils::hook::call(0x1402C3699, get_chat_font_handle);
@ -369,15 +369,18 @@ namespace patches
dvars::aimassist_enabled = game::Dvar_RegisterBool("aimassist_enabled", true,
game::DvarFlags::DVAR_FLAG_SAVED,
"Enables aim assist for controllers");
//client side aim assist dvar
// Client side aim assist dvar
utils::hook::call(0x14013B9AC, aim_assist_add_to_target_list);
// patch "Couldn't find the bsp for this map." error to not be fatal in mp
// Patch "Couldn't find the bsp for this map." error to not be fatal in mp
utils::hook::call(0x14031E8AB, bsp_sys_error_stub);
// isProfanity
utils::hook::set(0x1402F61B0, 0xC3C033);
// Don't register every replicated dvar as a network dvar
utils::hook::nop(0x1403E984E, 5); // Dvar_ForEach
// Prevent clients from ending the game as non host by sending 'end_game' lui notification
cmd_lui_notify_server_hook.create(0x1403926A0, cmd_lui_notify_server_stub);

View File

@ -32,10 +32,12 @@ namespace ranked
// Some dvar used in gsc
game::Dvar_RegisterBool("force_ranking", true, game::DVAR_FLAG_WRITE, "Force ranking");
// Fix sessionteam always returning none (SV_HasAssignedTeam_Internal)
utils::hook::set(0x140479CF0, 0xC300B0);
}
// Always run bots, even if xblive_privatematch is 0
// OP codes = xor eax, eax; inc eax; ret;
utils::hook::set<std::uint32_t>(0x140217020, 0xC0FFC031); // BG_BotSystemEnabled
utils::hook::set<std::uint8_t>(0x140217020 + 4, 0xC3);
@ -47,10 +49,6 @@ namespace ranked
utils::hook::set<std::uint32_t>(0x1402170E0, 0xC0FFC031); // BG_BotsUsingTeamDifficulty
utils::hook::set<std::uint8_t>(0x1402170E0 + 4, 0xC3);
// SV_HasAssignedTeam_Internal
// OP codes = mov al, 0; ret;
utils::hook::set(0x140479CF0, 0xC300B0);
}
};
}