ChargeTargetScan<CTerrorPlayer>::operator()
0x004d7080 · 816 bytes · __thiscall
_ZN16ChargeTargetScanI13CTerrorPlayerEclEPS0_
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* ChargeTargetScan<CTerrorPlayer>::TEMPNAMEPLACEHOLDERVALUE(CTerrorPlayer*) */
undefined4 __thiscall
ChargeTargetScan<CTerrorPlayer>::operator()
(ChargeTargetScan<CTerrorPlayer> *this,CTerrorPlayer *param_1)
{
float fVar1;
code *pcVar2;
char cVar3;
int iVar4;
int iVar5;
float *pfVar6;
undefined4 uVar7;
Vector *pVVar8;
longdouble lVar9;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
int local_1c;
float local_18;
float local_14;
float local_10;
local_2c = 0;
local_28 = 0;
if (___atan2f_finite == 0) {
local_1c = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_2c,0,0,0,0,
"/data/src/game/server/../../game/shared/terror/abilities/charge.cpp",0x68,
&operator()(CTerrorPlayer*)::tm_fmt,"(%s)%s","Unaccounted","TargetScan()");
local_1c = ___atan2f_finite;
}
iVar5 = _DAT_0105db00;
local_24 = local_2c;
local_20 = local_28;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 004d71e6 to 004d7234 has its CatchHandler @ 004d73e4 */
iVar4 = ThreadGetCurrentId();
if (iVar5 == iVar4) {
if ((char *)*_DAT_0105d15c != "TargetScan()") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc21c72,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
if (*(CTerrorPlayer **)(this + 4) != param_1) {
/* try { // try from 004d7140 to 004d7145 has its CatchHandler @ 004d73c3 */
cVar3 = (**(code **)(*(int *)param_1 + 300))(param_1);
if (cVar3 != '\0') {
/* try { // try from 004d724e to 004d73ac has its CatchHandler @ 004d73c3 */
iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
cVar3 = IsASurvivorTeam(iVar5);
if (cVar3 != '\0') {
cVar3 = (**(code **)(*(int *)this + 0xc))(this,param_1);
if (cVar3 != '\0') {
pfVar6 = (float *)(**(code **)(*(int *)param_1 + 0x288))(param_1);
if ((*(float *)(this + 0x50) - pfVar6[2]) * (*(float *)(this + 0x50) - pfVar6[2]) +
(*(float *)(this + 0x48) - *pfVar6) * (*(float *)(this + 0x48) - *pfVar6) +
(*(float *)(this + 0x4c) - pfVar6[1]) * (*(float *)(this + 0x4c) - pfVar6[1]) <=
*(float *)(this + 0x44) * *(float *)(this + 0x44)) {
pcVar2 = *(code **)(**(int **)(this + 4) + 0x3cc);
uVar7 = (**(code **)(*(int *)param_1 + 0x288))(param_1);
cVar3 = (*pcVar2)(*(undefined4 *)(this + 4),uVar7);
if (cVar3 != '\0') {
cVar3 = (**(code **)(*(int *)this + 8))(this,param_1);
if (cVar3 != '\0') {
fVar1 = *(float *)(this + 0x44);
local_14 = *(float *)(this + 0x58) * fVar1 + *(float *)(this + 0x4c);
local_10 = *(float *)(this + 0x5c) * fVar1 + *(float *)(this + 0x50);
local_18 = fVar1 * *(float *)(this + 0x54) + *(float *)(this + 0x48);
pVVar8 = (Vector *)(**(code **)(*(int *)param_1 + 0x288))(param_1);
lVar9 = (longdouble)
CalcDistanceToLineSegment
(pVVar8,(Vector *)(this + 0x48),(Vector *)&local_18,(float *)0x0);
if ((float)lVar9 <= 32.0) {
*(CTerrorPlayer **)(this + 0x2c) = param_1;
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::InsertBefore
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)
(this + 0x30),*(int *)(this + 0x3c),¶m_1);
}
}
}
}
}
}
}
}
iVar5 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar4 = ThreadGetCurrentId();
if (iVar5 == iVar4) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_1c != 0) {
(**(code **)(local_1c + 0x54))(local_1c,local_24,local_20,0,0,0);
}
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.