PathFollower::CheckProgress
0x00763c40 · 1443 bytes · __thiscall
_ZN12PathFollower13CheckProgressEP8INextBot
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* PathFollower::CheckProgress(INextBot*) */
undefined4 __thiscall PathFollower::CheckProgress(PathFollower *this,INextBot *param_1)
{
uint *puVar1;
float fVar2;
int iVar3;
char cVar4;
int *piVar5;
undefined4 uVar6;
int iVar7;
int iVar8;
float *pfVar9;
float *pfVar10;
longdouble lVar11;
float fVar12;
float fVar13;
float fVar14;
float fVar15;
int local_54;
float local_48;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (_towlower == 0) {
local_20 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_34,0,0,0,0,
"/data/src/game/server/nextbot/path/nextbotpathfollow.cpp",0x1bf,
&CheckProgress(INextBot*)::tm_fmt,"(%s)%s","PathFollower::CheckProgress",
"PathFollower::CheckProgress");
local_20 = _towlower;
}
iVar7 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 00763dd6 to 00763e36 has its CatchHandler @ 00764231 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar8 = ThreadGetCurrentId(), iVar7 == iVar8)) {
if ((char *)*_DAT_0105d15c != "PathFollower::CheckProgress") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcaa5de,(char *)0x0,0xcaa5de);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 00763cff to 00763d6a has its CatchHandler @ 00764210 */
piVar5 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
if (*(int *)(gpGlobals + 4) != gm_frameLastLookedAhead) {
lVar11 = (longdouble)CountdownTimer::Now();
if ((*(float *)(this + 0x4788) <= (float)lVar11) && (0.0 < *(float *)(this + 0x475c))) {
/* try { // try from 00763ea5 to 00764208 has its CatchHandler @ 00764210 */
pfVar9 = (float *)(**(code **)(*piVar5 + 300))(piVar5);
iVar7 = *(int *)(this + 0x4758);
fVar2 = *(float *)(this + 0x475c);
if ((iVar7 != 0) && (*(int *)(iVar7 + 0x18) == 0)) {
local_54 = 3;
local_48 = 0.0;
iVar8 = iVar7;
do {
cVar4 = (**(code **)(*piVar5 + 0xf8))(piVar5);
if (((cVar4 == '\0') ||
(fVar15 = *(float *)(iVar8 + 0xc) - pfVar9[1],
fVar13 = *(float *)(iVar8 + 0x10) - pfVar9[2],
fVar12 = *(float *)(iVar8 + 8) - *pfVar9,
fVar12 = fVar12 * fVar12 + fVar13 * fVar13 + fVar15 * fVar15, fVar2 * fVar2 <= fVar12)
) || ((iVar8 = (**(code **)(*(int *)this + 0x58))(this,iVar8), iVar8 == 0 ||
((*(int *)(iVar8 + 0x18) != 0 ||
(pfVar10 = (float *)(**(code **)(*piVar5 + 0x14c))(piVar5),
*(float *)(iVar8 + 0x20) * pfVar10[1] + *(float *)(iVar8 + 0x1c) * *pfVar10 +
*(float *)(iVar8 + 0x24) * pfVar10[2] <= 0.1)))))) break;
iVar3 = *(int *)(this + 0x4758);
if ((iVar3 == iVar7) ||
(fVar14 = *(float *)(iVar3 + 0xc) - *(float *)(iVar8 + 0xc),
fVar13 = *(float *)(iVar3 + 0x10) - *(float *)(iVar8 + 0x10),
fVar15 = *(float *)(iVar3 + 8) - *(float *)(iVar8 + 8),
576.0 <= fVar13 * fVar13 + fVar14 * fVar14 + fVar15 * fVar15)) {
local_48 = SQRT(fVar12 + 1.1920929e-07) + local_48;
if (*(float *)(this + 0x475c) * 1.25 < local_48) break;
gm_frameLastLookedAhead = *(int *)(gpGlobals + 4);
lVar11 = (longdouble)CountdownTimer::Now();
if ((float)lVar11 + 0.1 != *(float *)(this + 0x4788)) {
(**(code **)(*(int *)(this + 0x4780) + 4))(this + 0x4780,this + 0x4788);
*(float *)(this + 0x4788) = (float)lVar11 + 0.1;
}
if (*(float *)(this + 0x4784) != 0.1) {
(**(code **)(*(int *)(this + 0x4780) + 4))(this + 0x4780,this + 0x4784);
*(undefined4 *)(this + 0x4784) = 0x3dcccccd;
}
cVar4 = (**(code **)(*piVar5 + 0x158))(piVar5,pfVar9,iVar8 + 8,1,0);
if ((cVar4 == '\0') ||
(cVar4 = (**(code **)(*piVar5 + 0x15c))(piVar5,pfVar9,iVar8 + 8,0), cVar4 != '\0'))
break;
*(int *)(this + 0x4758) = iVar8;
}
local_54 = local_54 + -1;
if ((local_54 == 0) || (*(int *)(iVar8 + 0x18) != 0)) break;
} while( true );
}
}
}
uVar6 = IsAtGoal(this,param_1);
if ((char)uVar6 != '\0') {
iVar7 = (**(code **)(*(int *)this + 0x58))(this,*(undefined4 *)(this + 0x4758));
if (iVar7 != 0) {
*(int *)(this + 0x4758) = iVar7;
goto LAB_00763d79;
}
cVar4 = (**(code **)(*piVar5 + 0xf8))(piVar5);
if (cVar4 != '\0') {
piVar5 = (int *)(**(code **)(*piVar5 + 0xb0))(piVar5);
(**(code **)(*piVar5 + 0x20))(piVar5,this);
cVar4 = INextBot::IsDebugging(param_1,4);
if (cVar4 != '\0') {
DevMsg("PathFollower: OnMoveToSuccess\n");
}
lVar11 = (longdouble)(**(code **)(*(int *)this + 0x28))(this);
if (0.0 < (float)lVar11) {
(**(code **)(*(int *)this + 0x48))(this);
}
uVar6 = 0;
goto LAB_00763d79;
}
}
uVar6 = 1;
LAB_00763d79:
iVar7 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar8 = ThreadGetCurrentId(), iVar7 == iVar8)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
return uVar6;
}
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.