Skip to content

Commit

Permalink
reduce lag of tc_remove_anti on full servers
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Sep 17, 2024
1 parent 6b98649 commit f86aa86
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/game/client/gameclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2300,6 +2300,15 @@ void CGameClient::OnPredict()
if(g_Config.m_ClRemoveAnti)
{
m_ExtraPredictedWorld.CopyWorld(&m_PredictedWorld);

// Remove other tees to reduce lag and because they aren't really important in this case
for(int i = 0; i < MAX_CLIENTS; i++)
if(i != m_Snap.m_LocalClientId)
if (CCharacter* pDelChar = m_ExtraPredictedWorld.GetCharacterById(i))
pDelChar->Destroy();



CCharacter *pExtraChar = m_ExtraPredictedWorld.GetCharacterById(m_Snap.m_LocalClientId);
if(pExtraChar)
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/tater_variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MACRO_CONFIG_INT(ClLimitMouseToScreen, tc_limit_mouse_to_screen, 0, 0, 2, CFGFLA
MACRO_CONFIG_INT(ClFreezeUpdateFix, tc_freeze_update_fix, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Will change your skin faster when you enter freeze. ")
MACRO_CONFIG_INT(ClRemoveAnti, tc_remove_anti, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Removes some amount of antiping & player prediction in freeze")
MACRO_CONFIG_INT(ClUnfreezeLagTicks, tc_remove_anti_ticks, 5, 0, 20, CFGFLAG_CLIENT | CFGFLAG_SAVE, "The biggest amount of prediction ticks that are removed")
MACRO_CONFIG_INT(ClUnfreezeLagDelayTicks, tc_remove_anti_delay_ticks, 100, 0, 150, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How many ticks it takes to remove the maximum prediction after being frozen")
MACRO_CONFIG_INT(ClUnfreezeLagDelayTicks, tc_remove_anti_delay_ticks, 25, 0, 150, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How many ticks it takes to remove the maximum prediction after being frozen")

MACRO_CONFIG_INT(ClUnpredOthersInFreeze, tc_unpred_others_in_freeze, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Dont predict other players if you are frozen")
MACRO_CONFIG_INT(ClPredMarginInFreeze, tc_pred_margin_in_freeze, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "enable changing prediction margin while frozen")
Expand Down

0 comments on commit f86aa86

Please sign in to comment.