DirectChasePath::IsRepathNeeded
0x00951c70 · 349 bytes · __thiscall
_ZNK15DirectChasePath14IsRepathNeededEP8INextBotP11CBaseEntity
Decompiled
undefined (3 params)
/* DirectChasePath::IsRepathNeeded(INextBot*, CBaseEntity*) const */
bool __thiscall
DirectChasePath::IsRepathNeeded(DirectChasePath *this,INextBot *param_1,CBaseEntity *param_2)
{
char cVar1;
bool bVar2;
float *pfVar3;
int *piVar4;
longdouble lVar5;
float fVar6;
pfVar3 = (float *)(**(code **)(*(int *)param_1 + 0xd4))(param_1);
if (((byte)param_2[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_2);
}
fVar6 = SQRT((*(float *)(param_2 + 0x2e4) - pfVar3[1]) * (*(float *)(param_2 + 0x2e4) - pfVar3[1])
+ (*(float *)(param_2 + 0x2e0) - *pfVar3) * (*(float *)(param_2 + 0x2e0) - *pfVar3) +
(*(float *)(param_2 + 0x2e8) - pfVar3[2]) * (*(float *)(param_2 + 0x2e8) - pfVar3[2])
) * 0.33;
pfVar3 = (float *)(**(code **)(*(int *)this + 0x18))(this);
if (((byte)param_2[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_2);
}
if (fVar6 * fVar6 <
(*(float *)(param_2 + 0x2e0) - *pfVar3) * (*(float *)(param_2 + 0x2e0) - *pfVar3) +
(*(float *)(param_2 + 0x2e8) - pfVar3[2]) * (*(float *)(param_2 + 0x2e8) - pfVar3[2]) +
(*(float *)(param_2 + 0x2e4) - pfVar3[1]) * (*(float *)(param_2 + 0x2e4) - pfVar3[1])) {
return true;
}
piVar4 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
cVar1 = (**(code **)(*piVar4 + 0x168))(piVar4);
if (cVar1 == '\0') {
bVar2 = false;
}
else {
piVar4 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
lVar5 = (longdouble)(**(code **)(*piVar4 + 0x16c))(piVar4);
bVar2 = 2.0 < (float)lVar5;
}
return bVar2;
}
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.