mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
Don't reset antiping subconfiguration on startup
This commit is contained in:
parent
2d404bdfa0
commit
ba4eab1f1c
|
@ -57,7 +57,7 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID)
|
|||
|
||||
int PrevTick = Client()->PrevGameTick();
|
||||
|
||||
if (g_Config.m_ClAntiPingGrenade && LocalPlayerInGame && !(Client()->State() == IClient::STATE_DEMOPLAYBACK))
|
||||
if (m_pClient->AntiPingGrenade() && LocalPlayerInGame && !(Client()->State() == IClient::STATE_DEMOPLAYBACK))
|
||||
{
|
||||
// calc predicted game tick
|
||||
static int Offset = 0;
|
||||
|
|
|
@ -88,7 +88,7 @@ void CNamePlates::RenderNameplate(
|
|||
|
||||
void CNamePlates::OnRender()
|
||||
{
|
||||
if (!g_Config.m_ClNameplates || g_Config.m_ClAntiPingPlayers)
|
||||
if (!g_Config.m_ClNameplates || m_pClient->AntiPingPlayers())
|
||||
return;
|
||||
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
|
|
|
@ -257,7 +257,7 @@ void CPlayers::RenderHook(
|
|||
// set size
|
||||
RenderInfo.m_Size = 64.0f;
|
||||
|
||||
if (!g_Config.m_ClAntiPingPlayers)
|
||||
if (!m_pClient->AntiPingPlayers())
|
||||
{
|
||||
// use preditect players if needed
|
||||
if(pInfo.m_Local && g_Config.m_ClPredict && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
|
@ -290,7 +290,7 @@ void CPlayers::RenderHook(
|
|||
}
|
||||
|
||||
vec2 Position;
|
||||
if (!g_Config.m_ClAntiPingPlayers)
|
||||
if (!m_pClient->AntiPingPlayers())
|
||||
Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), IntraTick);
|
||||
else
|
||||
Position = parPosition;
|
||||
|
@ -305,7 +305,7 @@ void CPlayers::RenderHook(
|
|||
vec2 Pos = Position;
|
||||
vec2 HookPos;
|
||||
|
||||
if (!g_Config.m_ClAntiPingPlayers)
|
||||
if (!m_pClient->AntiPingPlayers())
|
||||
{
|
||||
if(pPlayerChar->m_HookedPlayer != -1)
|
||||
{
|
||||
|
@ -440,7 +440,7 @@ void CPlayers::RenderPlayer(
|
|||
|
||||
|
||||
// use preditect players if needed
|
||||
if (!g_Config.m_ClAntiPingPlayers)
|
||||
if (!m_pClient->AntiPingPlayers())
|
||||
{
|
||||
if(pInfo.m_Local && g_Config.m_ClPredict && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
{
|
||||
|
@ -475,7 +475,7 @@ void CPlayers::RenderPlayer(
|
|||
|
||||
vec2 Direction = GetDirection((int)(Angle*256.0f));
|
||||
vec2 Position;
|
||||
if (!g_Config.m_ClAntiPingPlayers)
|
||||
if (!m_pClient->AntiPingPlayers())
|
||||
Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), IntraTick);
|
||||
else
|
||||
Position = parPosition;
|
||||
|
@ -878,7 +878,7 @@ void CPlayers::RenderPlayer(
|
|||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
if(g_Config.m_ClNameplates && g_Config.m_ClAntiPingPlayers)
|
||||
if(g_Config.m_ClNameplates && m_pClient->AntiPingPlayers())
|
||||
{
|
||||
float FontSize = 18.0f + 20.0f * g_Config.m_ClNameplatesSize / 100.0f;
|
||||
float FontSizeClan = 18.0f + 20.0f * g_Config.m_ClNameplatesClanSize / 100.0f;
|
||||
|
@ -972,7 +972,7 @@ void CPlayers::OnRender()
|
|||
|
||||
static int predcnt = 0;
|
||||
|
||||
if (g_Config.m_ClAntiPingPlayers)
|
||||
if (m_pClient->AntiPingPlayers())
|
||||
{
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
|
@ -999,7 +999,7 @@ void CPlayers::OnRender()
|
|||
}
|
||||
}
|
||||
|
||||
if(g_Config.m_ClAntiPingPlayers && g_Config.m_ClPredict && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
if(m_pClient->AntiPingPlayers() && g_Config.m_ClPredict && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
if(m_pClient->m_Snap.m_pLocalCharacter && !(m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER))
|
||||
{
|
||||
// double ping = m_pClient->m_Snap.m_pLocalInfo->m_Latency;
|
||||
|
|
|
@ -461,7 +461,7 @@ void CGameClient::UpdatePositions()
|
|||
// local character position
|
||||
if(g_Config.m_ClPredict && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
{
|
||||
if (!g_Config.m_ClAntiPingPlayers)
|
||||
if(!AntiPingPlayers())
|
||||
{
|
||||
if(!m_Snap.m_pLocalCharacter || (m_Snap.m_pGameInfoObj && m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER))
|
||||
{
|
||||
|
@ -488,7 +488,7 @@ void CGameClient::UpdatePositions()
|
|||
vec2(m_Snap.m_pLocalCharacter->m_X, m_Snap.m_pLocalCharacter->m_Y), Client()->IntraGameTick());
|
||||
}
|
||||
|
||||
if (g_Config.m_ClAntiPingPlayers)
|
||||
if (AntiPingPlayers())
|
||||
{
|
||||
for (int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
|
@ -579,14 +579,6 @@ void CGameClient::OnRender()
|
|||
m_NewTick = false;
|
||||
m_NewPredictedTick = false;
|
||||
|
||||
if(g_Config.m_ClAntiPing != m_CurrentAntiPing)
|
||||
{
|
||||
g_Config.m_ClAntiPingPlayers = g_Config.m_ClAntiPing;
|
||||
g_Config.m_ClAntiPingGrenade = g_Config.m_ClAntiPing;
|
||||
g_Config.m_ClAntiPingWeapons = g_Config.m_ClAntiPing;
|
||||
m_CurrentAntiPing = g_Config.m_ClAntiPing;
|
||||
}
|
||||
|
||||
if(g_Config.m_ClDummy && !Client()->DummyConnected())
|
||||
g_Config.m_ClDummy = 0;
|
||||
|
||||
|
@ -664,7 +656,7 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker, bool IsDummy)
|
|||
|
||||
g_GameClient.m_pItems->AddExtraProjectile(&Proj);
|
||||
|
||||
if(g_Config.m_ClAntiPingWeapons && Proj.m_Type == WEAPON_GRENADE && !UseExtraInfo(&Proj))
|
||||
if(AntiPingWeapons() && Proj.m_Type == WEAPON_GRENADE && !UseExtraInfo(&Proj))
|
||||
{
|
||||
vec2 StartPos;
|
||||
vec2 Direction;
|
||||
|
@ -1310,7 +1302,7 @@ void CGameClient::OnPredict()
|
|||
}
|
||||
|
||||
static bool IsWeaker[2][MAX_CLIENTS] = {{0}};
|
||||
if(g_Config.m_ClAntiPingPlayers)
|
||||
if(AntiPingPlayers())
|
||||
FindWeaker(IsWeaker);
|
||||
|
||||
// repredict character
|
||||
|
@ -1338,7 +1330,7 @@ void CGameClient::OnPredict()
|
|||
int ReloadTimer = 0;
|
||||
vec2 PrevPos;
|
||||
|
||||
if(g_Config.m_ClAntiPingWeapons)
|
||||
if(AntiPingWeapons())
|
||||
{
|
||||
for(int Index = 0; Index < MaxProjectiles; Index++)
|
||||
PredictedProjectiles[Index].Deactivate();
|
||||
|
@ -1419,7 +1411,7 @@ void CGameClient::OnPredict()
|
|||
}
|
||||
}
|
||||
|
||||
if(g_Config.m_ClAntiPingWeapons)
|
||||
if(AntiPingWeapons())
|
||||
{
|
||||
const float ProximityRadius = 28.0f;
|
||||
CNetObj_PlayerInput Input;
|
||||
|
@ -1593,7 +1585,7 @@ void CGameClient::OnPredict()
|
|||
}
|
||||
|
||||
// calculate where everyone should move
|
||||
if(g_Config.m_ClAntiPingPlayers)
|
||||
if(AntiPingPlayers())
|
||||
{
|
||||
//first apply Tick to weaker players (players that the local client has strong hook against), then local, then stronger players
|
||||
for(int h = 0; h < 3; h++)
|
||||
|
@ -1623,7 +1615,7 @@ void CGameClient::OnPredict()
|
|||
}
|
||||
|
||||
// move all players and quantize their data
|
||||
if(g_Config.m_ClAntiPingPlayers)
|
||||
if(AntiPingPlayers())
|
||||
{
|
||||
// Everyone with weaker hook
|
||||
for(int c = 0; c < MAX_CLIENTS; c++)
|
||||
|
@ -1700,7 +1692,7 @@ void CGameClient::OnPredict()
|
|||
{
|
||||
m_PredictedChar = *World.m_apCharacters[m_Snap.m_LocalClientID];
|
||||
|
||||
if (g_Config.m_ClAntiPingPlayers)
|
||||
if (AntiPingPlayers())
|
||||
{
|
||||
for (int c = 0; c < MAX_CLIENTS; c++)
|
||||
{
|
||||
|
|
|
@ -363,11 +363,13 @@ public:
|
|||
|
||||
void FindWeaker(bool IsWeaker[2][MAX_CLIENTS]);
|
||||
|
||||
private:
|
||||
bool AntiPingPlayers() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingPlayers; }
|
||||
bool AntiPingGrenade() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingGrenade; }
|
||||
bool AntiPingWeapons() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingWeapons; }
|
||||
|
||||
private:
|
||||
bool m_DDRaceMsgSent[2];
|
||||
int m_ShowOthers[2];
|
||||
bool m_CurrentAntiPing;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue