about summary refs log tree commit diff
path: root/src/game/server/entities/character.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/server/entities/character.h')
-rw-r--r--src/game/server/entities/character.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/server/entities/character.h b/src/game/server/entities/character.h
index ece33e45..7b949e29 100644
--- a/src/game/server/entities/character.h
+++ b/src/game/server/entities/character.h
@@ -67,6 +67,15 @@ public:
 
 	void Freeze(int Tick);
 	int m_FreezeTicks;
+	
+	// bot detection
+	struct LastPosition {
+		float x;
+		float y;
+	};
+	bool HasBeenThereRecently(float x, float y, const LastPosition *&pos, int firstTick, int lastTick) const;
+	bool AimedAtCharRecently(float aimX, float aimY, const CCharacter *c, const LastPosition *&pos, const LastPosition *&posVictim, int firstTick);
+	float HowCloseToXRecently(vec2 x, const LastPosition *&pos, int firstTick);
 
 private:
 	// player controlling this character
@@ -134,6 +143,10 @@ private:
 	int m_ReckoningTick; // tick that we are performing dead reckoning From
 	CCharacterCore m_SendCore; // core that we should send
 	CCharacterCore m_ReckoningCore; // the dead reckoning core
+	
+	// bot detection
+	LastPosition *m_LastPositions;
+	int m_LastPositionsSize;
 
 };