PathFollower::FindBlocker
0x00764240 · 1681 bytes · __thiscall
_ZN12PathFollower11FindBlockerEP8INextBot
Decompiled
undefined (2 params)
/* PathFollower::FindBlocker(INextBot*) */
CBaseEntity * __thiscall PathFollower::FindBlocker(PathFollower *this,INextBot *param_1)
{
code *pcVar1;
CBaseEntity *pCVar2;
char cVar3;
int *piVar4;
int iVar5;
int *piVar6;
int *piVar7;
IHandleEntity *pIVar8;
float *pfVar9;
undefined4 uVar10;
int iVar11;
Vector *pVVar12;
longdouble lVar13;
longdouble lVar14;
float fVar15;
float fVar16;
float fVar17;
float fVar18;
float fVar19;
float local_fc;
float local_f8;
float local_f4;
float local_f0;
float local_e8;
float local_e4;
float local_e0;
undefined **local_dc [4];
float local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
undefined4 local_ac;
undefined4 local_a8;
float local_a4;
float local_9c;
float local_98;
float local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
CGameTrace local_70 [76];
CBaseEntity *local_24;
piVar4 = (int *)(**(code **)(*(int *)param_1 + 200))(param_1);
iVar5 = (**(code **)(*piVar4 + 0xbc))(piVar4,param_1,0xffffffff);
if (iVar5 == 1) {
piVar6 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
piVar7 = (int *)(**(code **)(*(int *)param_1 + 0xc4))(param_1);
pIVar8 = (IHandleEntity *)(**(code **)(*(int *)param_1 + 0xb4))(param_1);
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)local_dc,pIVar8,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
local_dc[0] = &PTR_ShouldHitEntity_00caa988;
lVar13 = (longdouble)(**(code **)(*piVar7 + 0x118))(piVar7);
fVar17 = (float)lVar13 * 0.25;
lVar13 = (longdouble)(**(code **)(*piVar6 + 0x130))(piVar6);
lVar14 = (longdouble)(**(code **)(*piVar7 + 0x124))(piVar7);
pfVar9 = (float *)(**(code **)(*piVar6 + 300))(piVar6);
local_f0 = *pfVar9;
local_f4 = pfVar9[1];
local_f8 = pfVar9[2];
pcVar1 = *(code **)(*(int *)this + 0x2c);
uVar10 = (**(code **)(*piVar6 + 300))(piVar6);
(*pcVar1)(this,uVar10,0,0);
iVar5 = (**(code **)(*(int *)this + 0x40))(this);
iVar5 = *(int *)(iVar5 + 0x1c);
if (iVar5 != 0) {
local_fc = 0.0;
fVar19 = ((float)lVar14 - (float)lVar13) * 0.5;
fVar18 = ((float)lVar14 + (float)lVar13) * 0.5;
do {
local_e8 = *(float *)(iVar5 + 8) - local_f0;
local_e4 = *(float *)(iVar5 + 0xc) - local_f4;
local_e0 = *(float *)(iVar5 + 0x10) - local_f8;
lVar13 = (longdouble)VectorNormalize((Vector *)&local_e8);
lVar14 = (longdouble)(**(code **)(*piVar7 + 0x118))(piVar7);
fVar15 = (float)lVar14 + (float)lVar14;
if (fVar15 <= (float)lVar13) {
fVar15 = (float)lVar13;
}
uVar10 = (**(code **)(*piVar7 + 0x130))(piVar7);
local_8c = 0;
local_bc = local_e8 * fVar15;
local_ac = 0;
local_b8 = local_e4 * fVar15;
local_a8 = 0;
local_b4 = fVar15 * local_e0;
local_cc = local_f0;
local_c8 = local_f4;
local_c4 = local_f8 + fVar18;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
local_a4 = -fVar18;
local_9c = fVar17;
local_98 = fVar17;
local_94 = fVar19;
local_88 = fVar19 * fVar19 + fVar17 * fVar17 + fVar17 * fVar17 < 1e-06;
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,uVar10,local_dc,local_70);
cVar3 = CGameTrace::DidHitNonWorldEntity(local_70);
if (cVar3 == '\0') {
local_f4 = *(float *)(iVar5 + 0xc);
local_f0 = *(float *)(iVar5 + 8);
}
else {
piVar6 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
pfVar9 = (float *)(**(code **)(*piVar6 + 300))(piVar6);
pCVar2 = local_24;
if (((byte)local_24[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(local_24);
}
fVar15 = *(float *)(iVar5 + 0xc) - local_f4;
fVar16 = *(float *)(iVar5 + 8) - local_f0;
local_f4 = *(float *)(iVar5 + 0xc);
local_f0 = *(float *)(iVar5 + 8);
if (0.0 < fVar15 * (*(float *)(pCVar2 + 0x2e4) - pfVar9[1]) +
fVar16 * (*(float *)(pCVar2 + 0x2e0) - *pfVar9)) {
iVar11 = (**(code **)(*piVar4 + 0xbc))(piVar4,param_1,local_24);
if (iVar11 == 1) {
cVar3 = INextBot::IsDebugging(param_1,4);
if (cVar3 != '\0') {
local_cc = -90.0;
local_c8 = 0.0;
local_c4 = 0.0;
piVar4 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
pVVar12 = (Vector *)(**(code **)(*piVar4 + 300))(piVar4);
NDebugOverlay::Circle(pVVar12,(QAngle *)&local_cc,10.0,0xff,0,0,0xff,true,1.0);
pCVar2 = local_24;
if (((byte)local_24[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(local_24);
}
piVar4 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
pVVar12 = (Vector *)(**(code **)(*piVar4 + 300))(piVar4);
NDebugOverlay::HorzArrow
(pVVar12,(Vector *)(pCVar2 + 0x2e0),1.0,0xff,0,0,0xff,true,1.0);
}
return local_24;
}
local_f4 = *(float *)(iVar5 + 0xc);
local_f0 = *(float *)(iVar5 + 8);
}
}
local_fc = local_fc + *(float *)(iVar5 + 0x28);
local_f8 = *(float *)(iVar5 + 0x10);
iVar5 = (**(code **)(*(int *)this + 0x58))(this,iVar5);
} while ((iVar5 != 0) && (local_fc < 750.0));
}
}
return (CBaseEntity *)0x0;
}
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.