diff --git a/src/engine/server.h b/src/engine/server.h index 780b8aaf8..982728151 100644 --- a/src/engine/server.h +++ b/src/engine/server.h @@ -332,7 +332,6 @@ public: virtual void OnClientPrepareInput(int ClientId, void *pInput) = 0; virtual void OnClientFreshInput(int ClientId, void *pInput) = 0; virtual void OnClientPredictedInput(int ClientId, void *pInput) = 0; - virtual void OnClientPredictedEarlyInput(int ClientId, void *pInput) = 0; virtual bool IsClientReady(int ClientId) const = 0; virtual bool IsClientPlayer(int ClientId) const = 0; diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index dc3214c80..f06733144 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -694,28 +694,6 @@ void CCharacter::OnPredictedInput(CNetObj_PlayerInput *pNewInput) mem_copy(&m_SavedInput, &m_Input, sizeof(m_SavedInput)); } -void CCharacter::OnDirectInput(CNetObj_PlayerInput *pNewInput) -{ - mem_copy(&m_LatestPrevInput, &m_LatestInput, sizeof(m_LatestInput)); - mem_copy(&m_LatestInput, pNewInput, sizeof(m_LatestInput)); - m_NumInputs++; - - // it is not allowed to aim in the center - if(m_LatestInput.m_TargetX == 0 && m_LatestInput.m_TargetY == 0) - m_LatestInput.m_TargetY = -1; - - Antibot()->OnDirectInput(m_pPlayer->GetCid()); - - if(m_NumInputs > 1 && m_pPlayer->GetTeam() != TEAM_SPECTATORS) - { - HandleWeaponSwitch(); - FireWeapon(true); - } - - mem_copy(&m_LatestPrevPrevInput, &m_LatestPrevInput, sizeof(m_LatestInput)); - mem_copy(&m_LatestPrevInput, &m_LatestInput, sizeof(m_LatestInput)); -} - void CCharacter::ReleaseHook() { m_Core.SetHookedPlayer(-1); @@ -742,7 +720,24 @@ void CCharacter::ResetInput() void CCharacter::WeaponTick() { - OnDirectInput(&m_Input); + mem_copy(&m_LatestPrevInput, &m_LatestInput, sizeof(m_LatestInput)); + mem_copy(&m_LatestInput, &m_Input, sizeof(m_LatestInput)); + m_NumInputs++; + + // it is not allowed to aim in the center + if(m_LatestInput.m_TargetX == 0 && m_LatestInput.m_TargetY == 0) + m_LatestInput.m_TargetY = -1; + + Antibot()->OnDirectInput(m_pPlayer->GetCid()); + + if(m_NumInputs > 1 && m_pPlayer->GetTeam() != TEAM_SPECTATORS) + { + HandleWeaponSwitch(); + FireWeapon(true); + } + + mem_copy(&m_LatestPrevPrevInput, &m_LatestPrevInput, sizeof(m_LatestInput)); + mem_copy(&m_LatestPrevInput, &m_LatestInput, sizeof(m_LatestInput)); } void CCharacter::PreTick() diff --git a/src/game/server/entities/character.h b/src/game/server/entities/character.h index 2476678b7..39594629f 100644 --- a/src/game/server/entities/character.h +++ b/src/game/server/entities/character.h @@ -61,7 +61,6 @@ public: void HandleJetpack(); void OnPredictedInput(CNetObj_PlayerInput *pNewInput); - void OnDirectInput(CNetObj_PlayerInput *pNewInput); void ReleaseHook(); void ResetHook(); diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index c8428c324..20f59ed68 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -315,7 +315,6 @@ public: void OnClientPrepareInput(int ClientId, void *pInput) override; void OnClientFreshInput(int ClientId, void *pInput) override; void OnClientPredictedInput(int ClientId, void *pInput) override; - void OnClientPredictedEarlyInput(int ClientId, void *pInput) override; void TeehistorianRecordAntibot(const void *pData, int DataSize) override; void TeehistorianRecordPlayerJoin(int ClientId, bool Sixup) override; diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 3bba3c285..515152aa4 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -499,7 +499,6 @@ void CPlayer::OnDisconnect() m_Moderating = false; } -// Copy a input into the charecters active input to be used during the main phase of the game tick void CPlayer::OnPlayerInput(CNetObj_PlayerInput *pNewInput) { m_PlayerFlags = pNewInput->m_PlayerFlags;