CTerrorPlayer::CheckAttackFrequency
0x009bae80 · 570 bytes · __thiscall
_ZN13CTerrorPlayer20CheckAttackFrequencyERK15CTakeDamageInfob
Decompiled
undefined (3 params)
/* CTerrorPlayer::CheckAttackFrequency(CTakeDamageInfo const&, bool) */
undefined4 __thiscall
CTerrorPlayer::CheckAttackFrequency(CTerrorPlayer *this,CTakeDamageInfo *param_1,bool param_2)
{
float *pfVar1;
uint uVar2;
int *piVar3;
int iVar4;
undefined *puVar5;
int iVar6;
int iVar7;
longdouble lVar8;
float fVar9;
float fVar10;
CUtlVector<CTerrorPlayer::InfectedDamageEvent,CUtlMemory<CTerrorPlayer::InfectedDamageEvent,int>>
*local_34;
undefined4 local_24;
float local_20;
uVar2 = *(uint *)(param_1 + 0x34);
if (uVar2 == 0xffffffff) {
return 1;
}
puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10;
if (puVar5 == (undefined *)0xfffffffc) {
return 1;
}
if (*(uint *)(puVar5 + 8) != uVar2 >> 0xc) {
return 1;
}
piVar3 = *(int **)(puVar5 + 4);
if (piVar3 == (int *)0x0) {
return 1;
}
iVar4 = (**(code **)(*piVar3 + 0x14c))(piVar3);
if (iVar4 == 0) {
return 1;
}
iVar4 = GetDifficulty();
if (iVar4 == 1) {
fVar10 = *(float *)(ZombieThrottleHitIntervalNormal._28_4_ + 0x2c);
goto LAB_009baf19;
}
if (iVar4 < 2) {
if (iVar4 == 0) {
fVar10 = *(float *)(ZombieThrottleHitIntervalEasy._28_4_ + 0x2c);
goto LAB_009baf19;
}
}
else {
if (iVar4 == 2) {
fVar10 = *(float *)(ZombieThrottleHitIntervalHard._28_4_ + 0x2c);
goto LAB_009baf19;
}
if (iVar4 == 3) {
fVar10 = *(float *)(ZombieThrottleHitIntervalExpert._28_4_ + 0x2c);
goto LAB_009baf19;
}
}
fVar10 = 1.0;
LAB_009baf19:
if ((0.0 < *(float *)(this + 0x3a94)) &&
(lVar8 = (longdouble)IntervalTimer::Now(), (float)lVar8 - *(float *)(this + 0x3a94) < fVar10))
{
return 0;
}
if (param_2) {
lVar8 = (longdouble)IntervalTimer::Now();
if ((float)lVar8 != *(float *)(this + 0x3a94)) {
(**(code **)(*(int *)(this + 0x3a90) + 4))(this + 0x3a90,this + 0x3a94);
*(float *)(this + 0x3a94) = (float)lVar8;
}
iVar4 = *(int *)(this + 0x3aa4);
iVar6 = iVar4 + -1;
fVar10 = *(float *)(common_dps_window._28_4_ + 0x2c);
if (iVar6 < 0) {
local_20 = *(float *)(gpGlobals + 0xc);
}
else {
iVar4 = iVar6 * 8;
local_20 = *(float *)(gpGlobals + 0xc);
do {
while (fVar9 = local_20 - fVar10, pfVar1 = (float *)(*(int *)(this + 15000) + 4 + iVar4),
*pfVar1 <= fVar9 && fVar9 != *pfVar1) {
iVar7 = iVar6 + -1;
iVar4 = iVar4 + -8;
CUtlVector<CTerrorPlayer::InfectedDamageEvent,CUtlMemory<CTerrorPlayer::InfectedDamageEvent,int>>
::ShiftElementsLeft((CUtlVector<CTerrorPlayer::InfectedDamageEvent,CUtlMemory<CTerrorPlayer::InfectedDamageEvent,int>>
*)(this + 15000),iVar6,1);
iVar6 = gpGlobals;
*(int *)(this + 0x3aa4) = *(int *)(this + 0x3aa4) + -1;
local_20 = *(float *)(iVar6 + 0xc);
iVar6 = iVar7;
if (iVar7 == -1) goto LAB_009bb03c;
}
iVar6 = iVar6 + -1;
iVar4 = iVar4 + -8;
} while (iVar6 != -1);
LAB_009bb03c:
iVar4 = *(int *)(this + 0x3aa4);
}
local_34 = (CUtlVector<CTerrorPlayer::InfectedDamageEvent,CUtlMemory<CTerrorPlayer::InfectedDamageEvent,int>>
*)(this + 15000);
local_24 = *(undefined4 *)(param_1 + 0x3c);
CUtlVector<CTerrorPlayer::InfectedDamageEvent,CUtlMemory<CTerrorPlayer::InfectedDamageEvent,int>>
::InsertBefore(local_34,iVar4,(InfectedDamageEvent *)&local_24);
}
return 1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.