From e30db2bf296671c656c85723fb075a4e62ba3c35 Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Wed, 21 Jul 2021 22:28:59 +0200 Subject: [PATCH 1/4] Add target clientid to antibot OnHammerHit --- src/antibot/antibot_interface.h | 2 +- src/antibot/antibot_null.cpp | 2 +- src/engine/server/antibot.cpp | 4 ++-- src/engine/server/antibot.h | 2 +- src/game/server/entities/character.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/antibot/antibot_interface.h b/src/antibot/antibot_interface.h index b689e4c35..b89220a08 100644 --- a/src/antibot/antibot_interface.h +++ b/src/antibot/antibot_interface.h @@ -22,7 +22,7 @@ ANTIBOTAPI void AntibotOnPlayerDestroy(int ClientID); ANTIBOTAPI void AntibotOnSpawn(int ClientID); ANTIBOTAPI void AntibotOnHammerFireReloading(int ClientID); ANTIBOTAPI void AntibotOnHammerFire(int ClientID); -ANTIBOTAPI void AntibotOnHammerHit(int ClientID); +ANTIBOTAPI void AntibotOnHammerHit(int ClientID, int TargetID); ANTIBOTAPI void AntibotOnDirectInput(int ClientID); ANTIBOTAPI void AntibotOnCharacterTick(int ClientID); ANTIBOTAPI void AntibotOnHookAttach(int ClientID, bool Player); diff --git a/src/antibot/antibot_null.cpp b/src/antibot/antibot_null.cpp index 708f85a45..f9715215b 100644 --- a/src/antibot/antibot_null.cpp +++ b/src/antibot/antibot_null.cpp @@ -28,7 +28,7 @@ void AntibotOnPlayerDestroy(int /*ClientID*/) {} void AntibotOnSpawn(int /*ClientID*/) {} void AntibotOnHammerFireReloading(int /*ClientID*/) {} void AntibotOnHammerFire(int /*ClientID*/) {} -void AntibotOnHammerHit(int /*ClientID*/) {} +void AntibotOnHammerHit(int /*ClientID*/, int /*TargetID*/) {} void AntibotOnDirectInput(int /*ClientID*/) {} void AntibotOnCharacterTick(int /*ClientID*/) {} void AntibotOnHookAttach(int /*ClientID*/, bool /*Player*/) {} diff --git a/src/engine/server/antibot.cpp b/src/engine/server/antibot.cpp index 5633aa962..90c08e9d7 100644 --- a/src/engine/server/antibot.cpp +++ b/src/engine/server/antibot.cpp @@ -120,10 +120,10 @@ void CAntibot::OnHammerFire(int ClientID) Update(); AntibotOnHammerFire(ClientID); } -void CAntibot::OnHammerHit(int ClientID) +void CAntibot::OnHammerHit(int ClientID, int TargetID) { Update(); - AntibotOnHammerHit(ClientID); + AntibotOnHammerHit(ClientID, TargetID); } void CAntibot::OnDirectInput(int ClientID) { diff --git a/src/engine/server/antibot.h b/src/engine/server/antibot.h index a73a6d98b..af032201d 100644 --- a/src/engine/server/antibot.h +++ b/src/engine/server/antibot.h @@ -46,7 +46,7 @@ public: virtual void OnSpawn(int ClientID); virtual void OnHammerFireReloading(int ClientID); virtual void OnHammerFire(int ClientID); - virtual void OnHammerHit(int ClientID); + virtual void OnHammerHit(int ClientID, int TargetID); virtual void OnDirectInput(int ClientID); virtual void OnCharacterTick(int ClientID); virtual void OnHookAttach(int ClientID, bool Player); diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index eb8645c3c..79c47b364 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -456,7 +456,7 @@ void CCharacter::FireWeapon() if(m_FreezeHammer) pTarget->Freeze(); - Antibot()->OnHammerHit(m_pPlayer->GetCID()); + Antibot()->OnHammerHit(m_pPlayer->GetCID(), pTarget->GetPlayer()->GetCID()); Hits++; } From 5450808d03f828ed9331517bf4f8fa9fac182e64 Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Thu, 22 Jul 2021 00:22:12 +0200 Subject: [PATCH 2/4] Forgot to add target here --- src/engine/antibot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/antibot.h b/src/engine/antibot.h index 4f03feefe..34827e53c 100644 --- a/src/engine/antibot.h +++ b/src/engine/antibot.h @@ -16,7 +16,7 @@ public: virtual void OnSpawn(int ClientID) = 0; virtual void OnHammerFireReloading(int ClientID) = 0; virtual void OnHammerFire(int ClientID) = 0; - virtual void OnHammerHit(int ClientID) = 0; + virtual void OnHammerHit(int ClientID, int TargetID) = 0; virtual void OnDirectInput(int ClientID) = 0; virtual void OnCharacterTick(int ClientID) = 0; virtual void OnHookAttach(int ClientID, bool Player) = 0; From 845ce60031490a003985ceed5a379ce5a2aadc42 Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Thu, 22 Jul 2021 02:15:28 +0200 Subject: [PATCH 3/4] Forgot it here too --- src/engine/server/antibot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/server/antibot.cpp b/src/engine/server/antibot.cpp index 90c08e9d7..da76d0bed 100644 --- a/src/engine/server/antibot.cpp +++ b/src/engine/server/antibot.cpp @@ -225,7 +225,7 @@ void CAntibot::OnPlayerDestroy(int ClientID) {} void CAntibot::OnSpawn(int ClientID) {} void CAntibot::OnHammerFireReloading(int ClientID) {} void CAntibot::OnHammerFire(int ClientID) {} -void CAntibot::OnHammerHit(int ClientID) {} +void CAntibot::OnHammerHit(int ClientID, int TargetID) {} void CAntibot::OnDirectInput(int ClientID) {} void CAntibot::OnCharacterTick(int ClientID) {} void CAntibot::OnHookAttach(int ClientID, bool Player) {} From acaf4b8fcfc322bad3e62a57127e0b3f5e185180 Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Tue, 27 Jul 2021 12:50:14 +0200 Subject: [PATCH 4/4] Increase antibot abi version --- src/antibot/antibot_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/antibot/antibot_data.h b/src/antibot/antibot_data.h index 52061f54c..03d39cef6 100644 --- a/src/antibot/antibot_data.h +++ b/src/antibot/antibot_data.h @@ -6,7 +6,7 @@ enum { - ANTIBOT_ABI_VERSION = 4, + ANTIBOT_ABI_VERSION = 5, ANTIBOT_MSGFLAG_NONVITAL = 1, ANTIBOT_MSGFLAG_FLUSH = 2,