Merge pull request #3961 from fokkonaut/pr-antibot

Add target clientid to antibot OnHammerHit
This commit is contained in:
Dennis Felsing 2021-12-19 19:33:56 +01:00 committed by GitHub
commit f03cb08150
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 9 deletions

View file

@ -6,7 +6,7 @@
enum
{
ANTIBOT_ABI_VERSION = 4,
ANTIBOT_ABI_VERSION = 5,
ANTIBOT_MSGFLAG_NONVITAL = 1,
ANTIBOT_MSGFLAG_FLUSH = 2,

View file

@ -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);

View file

@ -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*/) {}

View file

@ -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;

View file

@ -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)
{
@ -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) {}

View file

@ -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);

View file

@ -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++;
}