L L4D2node

PathFollower::IsAtGoal

0x00762d20 · 1205 bytes · __thiscall

_ZNK12PathFollower8IsAtGoalEP8INextBot

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* PathFollower::IsAtGoal(INextBot*) const */

bool __thiscall PathFollower::IsAtGoal(PathFollower *this,INextBot *param_1)

{
  uint *puVar1;
  float fVar2;
  int iVar3;
  code *pcVar4;
  char cVar5;
  int *piVar6;
  int *piVar7;
  int iVar8;
  float *pfVar9;
  int iVar10;
  undefined4 uVar11;
  bool bVar12;
  longdouble lVar13;
  longdouble extraout_ST0;
  longdouble extraout_ST0_00;
  longdouble extraout_ST0_01;
  float fVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  float fVar18;
  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",0x79,
               &IsAtGoal(INextBot*)::tm_fmt,"(%s)%s","NextBot","PathFollower::IsAtGoal");
    local_20 = _towlower;
  }
  iVar10 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 00762fa6 to 00763006 has its CatchHandler @ 007631f9 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar8 = ThreadGetCurrentId(), iVar10 == iVar8)) {
    if ((char *)*_DAT_0105d15c != "PathFollower::IsAtGoal") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcaa57c,(char *)0x0,0xca8906);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 00762ddc to 00762f27 has its CatchHandler @ 0076320e */
  piVar6 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
  piVar7 = (int *)(**(code **)(*(int *)param_1 + 0xc4))(param_1);
  iVar8 = (**(code **)(*(int *)this + 0x5c))(this,*(undefined4 *)(this + 0x4758));
  pfVar9 = (float *)(**(code **)(*piVar6 + 300))(piVar6);
  iVar10 = *(int *)(this + 0x4758);
  fVar15 = *pfVar9;
  fVar14 = pfVar9[1];
  fVar2 = pfVar9[2];
  fVar16 = *(float *)(iVar10 + 8);
  fVar17 = *(float *)(iVar10 + 0xc);
  fVar18 = *(float *)(iVar10 + 0x10);
  if (iVar8 != 0) {
    if (*(int *)(iVar10 + 0x18) == 1) {
      iVar10 = (**(code **)(*(int *)this + 0x58))(this,iVar10);
      if (iVar10 != 0) {
        iVar8 = (**(code **)(*piVar6 + 300))(piVar6);
        fVar15 = *(float *)(iVar8 + 8);
        fVar14 = *(float *)(iVar10 + 0x10);
        (**(code **)(*piVar6 + 0x130))(piVar6);
        bVar12 = fVar15 - fVar14 < (float)extraout_ST0_01;
        iVar10 = _DAT_0105db00;
        goto joined_r0x00762f46;
      }
    }
    else {
      if (*(int *)(iVar10 + 0x18) != 2) {
        iVar10 = (**(code **)(*(int *)this + 0x58))();
        fVar16 = fVar16 - fVar15;
        fVar17 = fVar17 - fVar14;
        if (iVar10 != 0) {
          iVar3 = *(int *)(this + 0x4758);
          fVar15 = *(float *)(iVar3 + 0x1c);
          if (*(int *)(iVar8 + 0x14) == 0) {
            fVar15 = fVar15 + *(float *)(iVar8 + 0x1c);
            fVar14 = *(float *)(iVar3 + 0x20) + *(float *)(iVar8 + 0x20);
          }
          else {
            fVar14 = *(float *)(iVar3 + 0x20);
          }
          if (fVar14 * fVar17 + fVar15 * fVar16 < 0.0001) {
            fVar18 = fVar18 - fVar2;
            lVar13 = (longdouble)(**(code **)(*piVar7 + 0x120))(piVar7);
            if (ABS(fVar18) < (float)lVar13) {
              lVar13 = (longdouble)(**(code **)(*piVar6 + 0x130))(piVar6);
              if (fVar18 < (float)lVar13) goto LAB_00762f3a;
              pcVar4 = *(code **)(*piVar6 + 0x158);
                    /* try { // try from 00763029 to 0076308d has its CatchHandler @ 0076320e */
              uVar11 = (**(code **)(*piVar6 + 300))(piVar6);
              cVar5 = (*pcVar4)(piVar6,uVar11,iVar10 + 8,1,0);
              if (cVar5 != '\0') {
                pcVar4 = *(code **)(*piVar6 + 0x15c);
                uVar11 = (**(code **)(*piVar6 + 300))(piVar6);
                cVar5 = (*pcVar4)(piVar6,uVar11,iVar10 + 8,0);
                if (cVar5 == '\0') goto LAB_00762f3a;
              }
            }
          }
        }
        (**(code **)(*piVar7 + 0x118))(piVar7);
        bVar12 = false;
        iVar10 = _DAT_0105db00;
        if (ABS(fVar16) < (float)extraout_ST0 * 0.5) {
          bVar12 = ABS(fVar17) < (float)extraout_ST0 * 0.5;
        }
        goto joined_r0x00762f46;
      }
                    /* try { // try from 00763138 to 007631e2 has its CatchHandler @ 0076320e */
      iVar10 = (**(code **)(*(int *)this + 0x58))(this,iVar10);
      if (iVar10 != 0) {
        iVar10 = (**(code **)(*piVar6 + 300))(piVar6);
        fVar14 = *(float *)(iVar10 + 8);
        fVar15 = *(float *)(*(int *)(this + 0x4758) + 0x10);
        (**(code **)(*piVar6 + 0x130))(piVar6);
        bVar12 = (float)extraout_ST0_00 + fVar15 < fVar14;
        iVar10 = _DAT_0105db00;
        goto joined_r0x00762f46;
      }
    }
  }
LAB_00762f3a:
  bVar12 = true;
  iVar10 = _DAT_0105db00;
joined_r0x00762f46:
  _DAT_0105db00 = iVar10;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar8 = ThreadGetCurrentId(), iVar10 == iVar8)) {
    cVar5 = CVProfNode::ExitScope();
    if (cVar5 != '\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 bVar12;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)