Better red dot fix

This commit is contained in:
Federico Cecchetto 2022-05-31 21:02:07 +02:00
parent 00f1279942
commit 189c13b14c

View File

@ -154,6 +154,16 @@ namespace patches
game::AimAssist_AddToTargetList(aaGlob, screenTarget); game::AimAssist_AddToTargetList(aaGlob, screenTarget);
} }
utils::hook::detour init_network_dvars_hook;
void init_network_dvars_stub(game::dvar_t* dvar)
{
static const auto hash = game::generateHashValue("r_tonemapHighlightRange");
if (dvar->hash == hash)
{
init_network_dvars_hook.invoke<void>(dvar);
}
}
} }
class component final : public component_interface class component final : public component_interface
@ -227,6 +237,9 @@ namespace patches
// disable codPointStore // disable codPointStore
dvars::override::register_int("codPointStore_enabled", 0, 0, 0, game::DVAR_FLAG_NONE); dvars::override::register_int("codPointStore_enabled", 0, 0, 0, game::DVAR_FLAG_NONE);
// don't register every replicated dvar as a network dvar (only r_tonemapHighlightRange, fixes red dots)
init_network_dvars_hook.create(0x4740C0_b, init_network_dvars_stub);
// patch "Server is different version" to show the server client version // patch "Server is different version" to show the server client version
utils::hook::inject(0x54DCE5_b, VERSION); utils::hook::inject(0x54DCE5_b, VERSION);