FindEnemyLookingAtMe::operator()
0x00970770 · 497 bytes · __thiscall
_ZN20FindEnemyLookingAtMeclEP11CBasePlayer
Decompiled
undefined (2 params)
/* FindEnemyLookingAtMe::TEMPNAMEPLACEHOLDERVALUE(CBasePlayer*) */
undefined4 __thiscall
FindEnemyLookingAtMe::operator()(FindEnemyLookingAtMe *this,CBasePlayer *param_1)
{
CBaseEntity *this_00;
code *pcVar1;
char cVar2;
undefined4 uVar3;
int iVar4;
int *piVar5;
undefined4 uVar6;
uVar3 = (**(code **)(*(int *)param_1 + 300))(param_1);
if (((char)uVar3 == '\0') ||
(cVar2 = (**(code **)(*(int *)param_1 + 0x558))(param_1), cVar2 != '\0')) {
uVar3 = 1;
}
else {
iVar4 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)this);
if (iVar4 == 3) {
iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
cVar2 = IsASurvivorTeam(iVar4);
if (cVar2 == '\0') {
return uVar3;
}
}
iVar4 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)this);
cVar2 = IsASurvivorTeam(iVar4);
if (((cVar2 == '\0') || (iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar4 == 3)
) && ((this[0xc] == (FindEnemyLookingAtMe)0x0 ||
(iVar4 = (**(code **)(*(int *)param_1 + 0x5f4))(param_1), iVar4 != 0)))) {
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
this_00 = *(CBaseEntity **)this;
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
if ((((*(float *)(this_00 + 0x2e4) - *(float *)(param_1 + 0x2e4)) *
(*(float *)(this_00 + 0x2e4) - *(float *)(param_1 + 0x2e4)) +
(*(float *)(this_00 + 0x2e8) - *(float *)(param_1 + 0x2e8)) *
(*(float *)(this_00 + 0x2e8) - *(float *)(param_1 + 0x2e8)) +
(*(float *)(this_00 + 0x2e0) - *(float *)(param_1 + 0x2e0)) *
(*(float *)(this_00 + 0x2e0) - *(float *)(param_1 + 0x2e0)) <=
*(float *)(this + 4) * *(float *)(this + 4)) &&
(cVar2 = (**(code **)(*(int *)param_1 + 0x41c))
(param_1,*(undefined4 *)this,*(undefined4 *)(this + 8)), cVar2 != '\0')
) && (cVar2 = (**(code **)(*(int *)param_1 + 0x42c))(param_1,*(undefined4 *)this,1),
cVar2 != '\0')) {
iVar4 = (**(code **)(**(int **)this + 0x144))(*(int **)this);
if (iVar4 != 0) {
piVar5 = (int *)(**(code **)(**(int **)this + 0x144))(*(int **)this);
pcVar1 = *(code **)(*piVar5 + 0x400);
uVar6 = (**(code **)(*(int *)param_1 + 0x288))(param_1);
cVar2 = (*pcVar1)(piVar5,uVar6);
if (cVar2 != '\0') {
return uVar3;
}
}
*(CBasePlayer **)(this + 0x10) = param_1;
uVar3 = 0;
}
}
}
return uVar3;
}
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.