CTerrorPlayer::UpdateRangeCull
0x009b53b0 · 805 bytes · __thiscall
_ZN13CTerrorPlayer15UpdateRangeCullEv
Decompiled
undefined (1 param)
/* CTerrorPlayer::UpdateRangeCull() */
void __thiscall CTerrorPlayer::UpdateRangeCull(CTerrorPlayer *this)
{
float fVar1;
bool bVar2;
int *piVar3;
char cVar4;
int iVar5;
int iVar6;
int iVar7;
longdouble lVar8;
float fVar9;
float local_44;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined1 local_2c;
int *local_28;
float local_24;
undefined4 local_20;
iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
if (((((iVar5 == 3) && (cVar4 = (**(code **)(*(int *)this + 300))(this), cVar4 != '\0')) &&
(((byte)this[0x14c] & 1) == 0)) &&
(lVar8 = (longdouble)(**(code **)(*(int *)this + 0x4a0))(this), 1.0 <= (float)lVar8)) &&
(((iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar5 != 3 ||
(iVar5 = (**(code **)(*(int *)this + 0x544))(this), iVar5 != 8)) &&
((((byte)this[0x153] & 8) == 0 &&
((iVar5 = (**(code **)(*(int *)this + 0x52c))(this), iVar5 == 0 ||
(*(char *)(iVar5 + 0x7d) == '\0')))))))) {
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
local_3c = *(undefined4 *)(this + 0x2e0);
local_2c = 1;
local_30 = 2;
local_38 = *(undefined4 *)(this + 0x2e4);
local_28 = (int *)0x0;
local_34 = *(undefined4 *)(this + 0x2e8);
local_24 = 1e+09;
local_20 = 0;
ForEachPlayer<ClosestPlayerScan>((ClosestPlayerScan *)&local_3c);
if (local_28 != (int *)0x0) {
iVar5 = (**(code **)(*local_28 + 0x52c))(local_28);
iVar6 = (**(code **)(*(int *)this + 0x52c))(this);
lVar8 = (longdouble)
CDirector::GetScriptValue
(TheDirector,"ZombieDiscardRange",
*(float *)(DirectorPrivate_DirectorZombieDiscardRange._28_4_ + 0x2c));
fVar1 = (float)lVar8;
bVar2 = fVar1 * fVar1 < local_24;
if (((!bVar2) &&
((iVar7 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar7 != 3 ||
(iVar7 = (**(code **)(*(int *)this + 0x544))(this), iVar7 != 8)))) &&
(((*(float *)(this + 0x3118) <= 0.0 ||
(lVar8 = (longdouble)IntervalTimer::Now(), 5.0 < (float)lVar8 - *(float *)(this + 0x3118)
)) && ((((*(float *)(ZombieDiscardMinRange._28_4_ + 0x2c) *
*(float *)(ZombieDiscardMinRange._28_4_ + 0x2c) < local_24 &&
(iVar7 = (**(code **)(*(int *)this + 0x52c))(this), piVar3 = local_28,
iVar7 != 0)) &&
(0.0 < *(float *)(iVar7 + 0x154) || *(float *)(iVar7 + 0x154) == 0.0)) &&
((local_28 != (int *)0x0 &&
(cVar4 = (**(code **)(*local_28 + 0x16c))(local_28), cVar4 != '\0')))))))) {
iVar7 = (**(code **)(*(int *)this + 0x52c))(this);
if (iVar7 == 0) {
local_44 = -9999.0;
}
else {
local_44 = *(float *)(iVar7 + 0x154);
}
iVar7 = (**(code **)(*piVar3 + 0x52c))(piVar3);
if (iVar7 == 0) {
fVar9 = -9999.0;
}
else {
fVar9 = *(float *)(iVar7 + 0x154);
}
bVar2 = fVar1 < ABS(local_44 - fVar9);
}
if ((((iVar6 == 0) || (iVar5 == 0)) ||
(*(float *)(iVar6 + 0x154) < *(float *)(iVar5 + 0x154) ||
*(float *)(iVar6 + 0x154) == *(float *)(iVar5 + 0x154))) && (bVar2)) {
StartRangeCull(this);
return;
}
}
}
CancelRangeCull(this);
return;
}
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.