AvoidActors::operator()
0x004aed70 · 1280 bytes · __thiscall
_ZN11AvoidActorsclEP20CBaseCombatCharacter
Decompiled
undefined (2 params)
/* AvoidActors::TEMPNAMEPLACEHOLDERVALUE(CBaseCombatCharacter*) */
undefined4 __thiscall AvoidActors::operator()(AvoidActors *this,CBaseCombatCharacter *param_1)
{
float fVar1;
float fVar2;
uint uVar3;
CBaseCombatCharacter *pCVar4;
char cVar5;
int iVar6;
int iVar7;
undefined *puVar8;
float *pfVar9;
float *pfVar10;
longdouble lVar11;
float fVar12;
float local_90;
float local_8c;
float local_88;
float local_84;
float local_80;
float local_7c;
float local_78;
float local_74;
float local_70;
float local_6c;
float local_68;
float local_64;
float local_60;
float local_5c;
float local_58;
float local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
float local_40;
float local_3c;
undefined4 local_38;
float local_34;
float local_30;
undefined4 local_2c;
float local_28;
float local_24;
float local_20;
if ((param_1 != (CBaseCombatCharacter *)0x0) && (param_1 != *(CBaseCombatCharacter **)this)) {
iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
iVar7 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)this);
pCVar4 = param_1;
if ((((iVar6 == iVar7) &&
((((byte)param_1[0x1b4] & 4) == 0 &&
(cVar5 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar5 != '\0')))) &&
(((((uVar3 = *(uint *)(pCVar4 + 0x3e68), uVar3 != 0xffffffff &&
(((puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc &&
(*(uint *)(puVar8 + 8) == uVar3 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)))) ||
(((uVar3 = *(uint *)(pCVar4 + 0x3e48), uVar3 != 0xffffffff &&
(puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc))
&& ((*(uint *)(puVar8 + 8) == uVar3 >> 0xc && (*(int *)(puVar8 + 4) != 0)))))) ||
((((uVar3 = *(uint *)(pCVar4 + 0x33c4), uVar3 != 0xffffffff &&
(puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar8 + 8) == uVar3 >> 0xc)) &&
((*(int *)(puVar8 + 4) != 0 && (pCVar4[0x39f1] == (CBaseCombatCharacter)0x0)))))) ||
(cVar5 = (**(code **)(*(int *)pCVar4 + 0x7e8))(pCVar4), cVar5 == '\0')))) &&
(cVar5 = (**(code **)(*(int *)pCVar4 + 0x558))(pCVar4), pCVar4 = param_1, cVar5 == '\0')) {
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
fVar1 = *(float *)(pCVar4 + 0x2e0);
fVar2 = *(float *)(pCVar4 + 0x2e4);
fVar12 = *(float *)(pCVar4 + 0x2e8);
pfVar9 = (float *)(**(code **)(*(int *)(param_1 + 0x194) + 4))(param_1 + 0x194);
local_84 = fVar2 + pfVar9[1];
local_88 = fVar1 + *pfVar9;
local_80 = fVar12 + pfVar9[2];
pfVar9 = (float *)(**(code **)(*(int *)(param_1 + 0x194) + 8))(param_1 + 0x194);
local_7c = fVar1 + *pfVar9;
local_78 = fVar2 + pfVar9[1];
local_74 = fVar12 + pfVar9[2];
pfVar10 = (float *)(**(code **)(*(int *)(*(int *)this + 0x194) + 4))(*(int *)this + 0x194);
pfVar9 = *(float **)(this + 4);
local_70 = *pfVar10 + *pfVar9;
local_6c = pfVar10[1] + pfVar9[1];
local_68 = pfVar10[2] + pfVar9[2];
pfVar10 = (float *)(**(code **)(*(int *)(*(int *)this + 0x194) + 8))(*(int *)this + 0x194);
pfVar9 = *(float **)(this + 4);
local_64 = *pfVar10 + *pfVar9;
local_60 = pfVar10[1] + pfVar9[1];
local_5c = pfVar10[2] + pfVar9[2];
cVar5 = IsBoxIntersectingBox
((Vector *)&local_70,(Vector *)&local_64,(Vector *)&local_88,
(Vector *)&local_7c);
if (cVar5 != '\0') {
fVar12 = *(float *)(this + 0x18) * 0.5 * (((local_64 + local_7c) - local_70) - local_88);
local_58 = fVar1 - **(float **)(this + 4);
local_54 = fVar2 - (*(float **)(this + 4))[1];
local_50 = 0;
lVar11 = (longdouble)VectorNormalize((Vector *)&local_58);
if ((float)lVar11 <= fVar12) {
local_4c = *(undefined4 *)(this + 8);
local_48 = *(undefined4 *)(this + 0xc);
local_40 = **(float **)(this + 4) - *(float *)(this + 8);
local_3c = (*(float **)(this + 4))[1] - *(float *)(this + 0xc);
local_2c = 0;
local_38 = 0;
local_44 = 0;
local_34 = fVar1;
local_30 = fVar2;
cVar5 = IntersectRayWithSphere
((Vector *)&local_4c,(Vector *)&local_40,(Vector *)&local_34,fVar12,
&local_90,&local_8c);
if (cVar5 != '\0') {
local_20 = 0.0;
local_28 = **(float **)(this + 4) - local_34;
local_24 = (*(float **)(this + 4))[1] - local_30;
if ((((local_28 <= -0.01) || (0.01 <= local_28)) || (local_24 <= -0.01)) ||
(0.01 <= local_24)) {
lVar11 = (longdouble)VectorNormalize((Vector *)&local_28);
pfVar9 = *(float **)(this + 4);
fVar12 = fVar12 - (float)lVar11;
local_28 = local_28 * fVar12;
local_24 = local_24 * fVar12;
local_20 = fVar12 * local_20;
*pfVar9 = local_28 + *pfVar9;
pfVar9[1] = pfVar9[1] + local_24;
pfVar9[2] = pfVar9[2] + local_20;
CUtlVector<CBaseCombatCharacter*,CUtlMemory<CBaseCombatCharacter*,int>>::InsertBefore
((CUtlVector<CBaseCombatCharacter*,CUtlMemory<CBaseCombatCharacter*,int>> *)
(this + 0x1c),*(int *)(this + 0x28),¶m_1);
}
}
}
}
}
}
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.