From 789d7d81fcbff0c5ef8e38add95369d5a76d90e1 Mon Sep 17 00:00:00 2001 From: c0d3d3v Date: Thu, 19 May 2022 19:50:51 +0200 Subject: [PATCH 1/2] keep input if chat is closed --- src/game/client/components/controls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index d0fd13047..4c065b77c 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -258,7 +258,7 @@ int CControls::SnapInput(int *pData) { if(m_InputData[g_Config.m_ClDummy].m_PlayerFlags == PLAYERFLAG_CHATTING) { - if(GameClient()->m_GameInfo.m_BugDDRaceInput) + if(!GameClient()->m_GameInfo.m_BugDDRaceInput) ResetInput(g_Config.m_ClDummy); } m_InputData[g_Config.m_ClDummy].m_PlayerFlags = PLAYERFLAG_PLAYING; From f5ff2275617eb2e2bcd947bc4c5ca846e2b642ef Mon Sep 17 00:00:00 2001 From: c0d3d3v Date: Thu, 19 May 2022 23:05:15 +0200 Subject: [PATCH 2/2] fix inputs on vanilla server if chat is open --- src/game/client/components/controls.cpp | 7 ------- src/game/client/gameclient.cpp | 1 + src/game/client/prediction/entities/character.cpp | 9 ++++++--- src/game/client/prediction/gameworld.h | 1 + src/game/server/player.cpp | 4 ---- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index 4c065b77c..385077533 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -255,14 +255,7 @@ int CControls::SnapInput(int *pData) else if(m_pClient->m_Menus.IsActive()) m_InputData[g_Config.m_ClDummy].m_PlayerFlags = PLAYERFLAG_IN_MENU; else - { - if(m_InputData[g_Config.m_ClDummy].m_PlayerFlags == PLAYERFLAG_CHATTING) - { - if(!GameClient()->m_GameInfo.m_BugDDRaceInput) - ResetInput(g_Config.m_ClDummy); - } m_InputData[g_Config.m_ClDummy].m_PlayerFlags = PLAYERFLAG_PLAYING; - } if(m_pClient->m_Scoreboard.Active()) m_InputData[g_Config.m_ClDummy].m_PlayerFlags |= PLAYERFLAG_SCOREBOARD; diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index cc4685e87..cb84331aa 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -2253,6 +2253,7 @@ void CGameClient::UpdatePrediction() m_GameWorld.m_WorldConfig.m_UseTuneZones = m_GameInfo.m_PredictDDRaceTiles; m_GameWorld.m_WorldConfig.m_PredictFreeze = g_Config.m_ClPredictFreeze; m_GameWorld.m_WorldConfig.m_PredictWeapons = AntiPingWeapons(); + m_GameWorld.m_WorldConfig.m_BugDDRaceInput = m_GameInfo.m_BugDDRaceInput; // always update default tune zone, even without character if(!m_GameWorld.m_WorldConfig.m_UseTuneZones) diff --git a/src/game/client/prediction/entities/character.cpp b/src/game/client/prediction/entities/character.cpp index b646b7bad..81af8539c 100644 --- a/src/game/client/prediction/entities/character.cpp +++ b/src/game/client/prediction/entities/character.cpp @@ -494,8 +494,12 @@ void CCharacter::GiveNinja() void CCharacter::OnPredictedInput(CNetObj_PlayerInput *pNewInput) { // skip the input if chat is active - if(pNewInput->m_PlayerFlags & PLAYERFLAG_CHATTING) + if(GameWorld()->m_WorldConfig.m_BugDDRaceInput && pNewInput->m_PlayerFlags & PLAYERFLAG_CHATTING) + { + // save reseted input + mem_copy(&m_SavedInput, &m_Input, sizeof(m_SavedInput)); return; + } // copy new input mem_copy(&m_Input, pNewInput, sizeof(m_Input)); @@ -511,11 +515,10 @@ void CCharacter::OnPredictedInput(CNetObj_PlayerInput *pNewInput) void CCharacter::OnDirectInput(CNetObj_PlayerInput *pNewInput) { // skip the input if chat is active - if(pNewInput->m_PlayerFlags & PLAYERFLAG_CHATTING) + if(GameWorld()->m_WorldConfig.m_BugDDRaceInput && pNewInput->m_PlayerFlags & PLAYERFLAG_CHATTING) { // reset input ResetInput(); - return; } diff --git a/src/game/client/prediction/gameworld.h b/src/game/client/prediction/gameworld.h index c10ef2d77..bb037fd91 100644 --- a/src/game/client/prediction/gameworld.h +++ b/src/game/client/prediction/gameworld.h @@ -72,6 +72,7 @@ public: bool m_PredictDDRace; bool m_IsSolo; bool m_UseTuneZones; + bool m_BugDDRaceInput; } m_WorldConfig; bool m_IsValidCopy; diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index e8745ec10..11f895df7 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -538,10 +538,6 @@ void CPlayer::OnDirectInput(CNetObj_PlayerInput *NewInput) if(m_PlayerFlags & PLAYERFLAG_CHATTING) return; - // reset input - if(m_pCharacter) - m_pCharacter->ResetInput(); - m_PlayerFlags = NewInput->m_PlayerFlags; return; }