about summary refs log tree commit diff
path: root/src/game/server/entities
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-12-10 18:21:12 +0100
committeroy <Tom_Adams@web.de>2011-12-10 18:21:12 +0100
commit99f04a7f87fb7f6b12f3865e255e9a3bd7ac9e9e (patch)
tree3e614f8bb09b7c39d6d6ac583720bb693855477e /src/game/server/entities
parent242e551142834c8bf1d34ec00b6a40214f0a253d (diff)
downloadzcatch-99f04a7f87fb7f6b12f3865e255e9a3bd7ac9e9e.tar.gz
zcatch-99f04a7f87fb7f6b12f3865e255e9a3bd7ac9e9e.zip
let the server check if the input aims the center. Closes #889
Diffstat (limited to 'src/game/server/entities')
-rw-r--r--src/game/server/entities/character.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index e926c305..5e8c29b6 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -507,7 +507,7 @@ void CCharacter::OnPredictedInput(CNetObj_PlayerInput *pNewInput)
 	mem_copy(&m_Input, pNewInput, sizeof(m_Input));
 	m_NumInputs++;
 
-	// or are not allowed to aim in the center
+	// it is not allowed to aim in the center
 	if(m_Input.m_TargetX == 0 && m_Input.m_TargetY == 0)
 		m_Input.m_TargetY = -1;
 }
@@ -517,6 +517,10 @@ void CCharacter::OnDirectInput(CNetObj_PlayerInput *pNewInput)
 	mem_copy(&m_LatestPrevInput, &m_LatestInput, sizeof(m_LatestInput));
 	mem_copy(&m_LatestInput, pNewInput, sizeof(m_LatestInput));
 
+	// 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;
+
 	if(m_NumInputs > 2 && m_pPlayer->GetTeam() != TEAM_SPECTATORS)
 	{
 		HandleWeaponSwitch();