L L4D2node

PathFollower::LadderUpdate

0x00763220 · 2476 bytes · __thiscall

_ZN12PathFollower12LadderUpdateEP8INextBot

Decompiled

undefined (2 params)

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

undefined4 __thiscall PathFollower::LadderUpdate(PathFollower *this,INextBot *param_1)

{
  uint *puVar1;
  code *pcVar2;
  char cVar3;
  int *piVar4;
  int *piVar5;
  undefined4 uVar6;
  int iVar7;
  int iVar8;
  float *pfVar9;
  undefined4 uVar10;
  longdouble lVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  int local_54;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_40;
  undefined4 local_3c;
  int local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  local_4c = 0;
  local_48 = 0;
  if (_towlower == 0) {
    local_38 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_4c,0,0,0,0,
               "/data/src/game/server/nextbot/path/nextbotpathfollow.cpp",0xfb,
               &LadderUpdate(INextBot*)::tm_fmt,"(%s)%s","NextBot","PathFollower::LadderUpdate");
    local_38 = _towlower;
  }
  iVar8 = _DAT_0105db00;
  local_40 = local_4c;
  local_3c = local_48;
                    /* try { // try from 007633ce to 0076342e has its CatchHandler @ 00763c25 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar7 = ThreadGetCurrentId(), iVar8 == iVar7)) {
    if ((char *)*_DAT_0105d15c != "PathFollower::LadderUpdate") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcaa593,(char *)0x0,0xca8906);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 007632dc to 007632fc has its CatchHandler @ 00763c23 */
  piVar4 = (int *)(**(code **)(*(int *)param_1 + 0xc0))(param_1);
  piVar5 = (int *)(**(code **)(*(int *)param_1 + 0xc4))(param_1);
  uVar6 = (**(code **)(*piVar4 + 0x114))(piVar4);
  if ((char)uVar6 == '\0') {
    local_54 = *(int *)(this + 0x4758);
    if (*(int *)(local_54 + 0x14) == 0) {
                    /* try { // try from 007638fd to 00763902 has its CatchHandler @ 00763c23 */
      iVar8 = (**(code **)(*(int *)param_1 + 0xb4))(param_1);
      if (*(char *)(iVar8 + 0x186) == '\t') {
                    /* try { // try from 007639c1 to 00763a1d has its CatchHandler @ 00763c23 */
        iVar8 = (**(code **)(*(int *)this + 0x5c))(this,*(undefined4 *)(this + 0x4758));
        local_54 = iVar8;
        if (iVar8 == 0) goto LAB_00763331;
        do {
                    /* try { // try from 00763ae2 to 00763b36 has its CatchHandler @ 00763c23 */
          if (((*(int *)(local_54 + 0x14) != 0) && (*(int *)(local_54 + 4) == 5)) &&
             (fVar13 = *(float *)(*(int *)(local_54 + 0x14) + 0x1c),
             lVar11 = (longdouble)(**(code **)(*piVar4 + 0x134))(piVar4), (float)lVar11 < fVar13)) {
            fVar13 = *(float *)(local_54 + 0x10);
            iVar7 = (**(code **)(*piVar4 + 300))(piVar4);
            fVar16 = *(float *)(iVar7 + 8);
            lVar11 = (longdouble)(**(code **)(*piVar4 + 0x134))(piVar4);
            if (ABS(fVar13 - fVar16) < (float)lVar11) {
              *(int *)(this + 0x4758) = local_54;
              goto LAB_00763919;
            }
          }
          local_54 = (**(code **)(*(int *)this + 0x58))(this,local_54);
        } while ((local_54 != 0) &&
                ((iVar8 == local_54 ||
                 (pfVar9 = (float *)(**(code **)(*piVar4 + 300))(piVar4),
                 fVar16 = *(float *)(local_54 + 8) - *pfVar9,
                 fVar13 = *(float *)(local_54 + 0xc) - pfVar9[1],
                 fVar13 * fVar13 + fVar16 * fVar16 <= 2500.0))));
      }
      local_54 = *(int *)(this + 0x4758);
LAB_00763919:
      if (*(int *)(local_54 + 0x14) == 0) goto LAB_00763331;
    }
    if (*(int *)(local_54 + 4) == 4) {
                    /* try { // try from 007634cd to 007635db has its CatchHandler @ 00763c1f */
      cVar3 = (**(code **)(*piVar4 + 0x114))(piVar4);
      if (cVar3 == '\0') {
                    /* try { // try from 00763a5d to 00763ac4 has its CatchHandler @ 00763c1f */
        iVar8 = (**(code **)(*piVar4 + 300))(piVar4);
        fVar13 = *(float *)(iVar8 + 8);
        fVar16 = *(float *)(*(int *)(*(int *)(this + 0x4758) + 0x14) + 0xc);
        lVar11 = (longdouble)(**(code **)(*piVar4 + 0x130))(piVar4);
        if (fVar16 - (float)lVar11 < fVar13) {
          uVar10 = (**(code **)(*(int *)this + 0x58))(this,*(undefined4 *)(this + 0x4758));
          *(undefined4 *)(this + 0x4758) = uVar10;
          goto LAB_00763331;
        }
      }
      pfVar9 = (float *)(**(code **)(*piVar4 + 300))(piVar4);
      fVar15 = *(float *)(*(int *)(*(int *)(this + 0x4758) + 0x14) + 0x10) - *pfVar9;
      fVar14 = *(float *)(*(int *)(*(int *)(this + 0x4758) + 0x14) + 0x14) - pfVar9[1];
      pcVar2 = *(code **)(*piVar5 + 0xc0);
      iVar7 = (**(code **)(*(int *)param_1 + 0xb8))(param_1);
      lVar11 = (longdouble)(**(code **)(*piVar5 + 0x124))(piVar5);
      iVar8 = *(int *)(*(int *)(this + 0x4758) + 0x14);
      local_24 = *(float *)(iVar8 + 8) - *(float *)(iVar8 + 0x44) * 50.0;
      local_28 = *(float *)(iVar8 + 4) - *(float *)(iVar8 + 0x40) * 50.0;
      local_20 = (*(float *)(iVar8 + 0xc) - *(float *)(iVar8 + 0x48) * 50.0) + (float)lVar11;
      (*pcVar2)(piVar5,&local_28,3,0x40000000,0,"Mounting upward ladder",iVar7 != 0,0x3e800000);
      fVar16 = SQRT(fVar15 * fVar15 + fVar14 * fVar14);
      fVar12 = 0.0;
      fVar13 = fVar12;
      if (fVar16 != 0.0) {
        fVar12 = fVar15 * (1.0 / fVar16);
        fVar13 = (1.0 / fVar16) * fVar14;
      }
      fVar14 = *(float *)(NextBotLadderAlignRange._28_4_ + 0x2c);
      if (fVar14 <= fVar16) goto LAB_00763331;
      iVar8 = *(int *)(*(int *)(this + 0x4758) + 0x14);
      fVar15 = fVar13 * *(float *)(iVar8 + 0x44) + fVar12 * *(float *)(iVar8 + 0x40);
      if (fVar15 < -0.9) {
                    /* try { // try from 00763b6e to 00763ba6 has its CatchHandler @ 00763bf8 */
        (**(code **)(*piVar4 + 0xb4))(piVar4,iVar8 + 0x10,0x3f800000);
        if (fVar16 < 25.0) {
          (**(code **)(*piVar4 + 0x10c))
                    (piVar4,(*(undefined4 **)(this + 0x4758))[5],**(undefined4 **)(this + 0x4758));
        }
      }
      else {
        local_20 = *(float *)(iVar8 + 0x18);
        if (fVar15 < 0.0) {
          fVar14 = (fVar14 + -25.0) * (fVar15 + 1.0) + 25.0;
        }
        local_28 = *(float *)(iVar8 + 0x10) - fVar14 * fVar12;
        local_24 = *(float *)(iVar8 + 0x14) - fVar14 * fVar13;
        if (fVar13 * *(float *)(iVar8 + 0x40) + -*(float *)(iVar8 + 0x44) * fVar12 < 0.0) {
          local_28 = -fVar13 * 10.0 + local_28;
          local_24 = fVar12 * 10.0 + local_24;
        }
        else {
          local_28 = local_28 - -fVar13 * 10.0;
          local_24 = local_24 - fVar12 * 10.0;
        }
                    /* try { // try from 00763713 to 00763718 has its CatchHandler @ 00763bf8 */
        (**(code **)(*piVar4 + 0xb4))(piVar4,&local_28,0x3f800000);
      }
    }
    else if (*(int *)(local_54 + 4) == 5) {
                    /* try { // try from 00763455 to 007634b4 has its CatchHandler @ 00763c23 */
      iVar8 = (**(code **)(*piVar4 + 300))(piVar4);
      fVar13 = *(float *)(iVar8 + 8);
      fVar16 = *(float *)(*(int *)(*(int *)(this + 0x4758) + 0x14) + 0x18);
      lVar11 = (longdouble)(**(code **)(*piVar4 + 0x130))(piVar4);
      if ((float)lVar11 + fVar16 <= fVar13) {
        iVar8 = *(int *)(*(int *)(this + 0x4758) + 0x14);
                    /* try { // try from 00763734 to 007638ef has its CatchHandler @ 00763c21 */
        lVar11 = (longdouble)(**(code **)(*piVar5 + 0x118))(piVar5);
        fVar13 = (float)lVar11 * 0.5;
        iVar7 = *(int *)(*(int *)(this + 0x4758) + 0x14);
        local_30 = *(float *)(iVar8 + 0x44) * fVar13 + *(float *)(iVar7 + 8);
        local_2c = *(float *)(iVar8 + 0x48) * fVar13 + *(float *)(iVar7 + 0xc);
        local_34 = fVar13 * *(float *)(iVar8 + 0x40) + *(float *)(iVar7 + 4);
        pfVar9 = (float *)(**(code **)(*piVar4 + 300))(piVar4);
        fVar16 = local_34 - *pfVar9;
        fVar13 = local_30 - pfVar9[1];
        cVar3 = INextBot::IsDebugging(param_1,4);
        if (cVar3 != '\0') {
                    /* try { // try from 00763966 to 00763999 has its CatchHandler @ 00763c21 */
          NDebugOverlay::Sphere((Vector *)&local_34,5.0,0xff,0,0xff,true,0.1);
        }
        pcVar2 = *(code **)(*piVar5 + 0xc0);
        lVar11 = (longdouble)(**(code **)(*piVar5 + 0x124))(piVar5);
        iVar8 = *(int *)(*(int *)(this + 0x4758) + 0x14);
        local_24 = *(float *)(iVar8 + 0x44) * 50.0 + *(float *)(iVar8 + 0x14);
        local_28 = *(float *)(iVar8 + 0x40) * 50.0 + *(float *)(iVar8 + 0x10);
        local_20 = *(float *)(iVar8 + 0x48) * 50.0 + *(float *)(iVar8 + 0x18) + (float)lVar11;
        (*pcVar2)(piVar5,&local_28,3,0x3f800000,0,"Mounting downward ladder",1,0x3e800000);
        if ((25.0 <= SQRT(fVar16 * fVar16 + fVar13 * fVar13)) &&
           (iVar8 = (**(code **)(*(int *)param_1 + 0xb4))(param_1), *(char *)(iVar8 + 0x186) != '\t'
           )) goto LAB_00763331;
        (**(code **)(*piVar4 + 0x110))
                  (piVar4,(*(undefined4 **)(this + 0x4758))[5],**(undefined4 **)(this + 0x4758));
        uVar6 = (**(code **)(*(int *)this + 0x58))(this,*(undefined4 *)(this + 0x4758));
      }
      else {
        uVar6 = (**(code **)(*(int *)this + 0x58))(this,*(undefined4 *)(this + 0x4758));
      }
      *(undefined4 *)(this + 0x4758) = uVar6;
    }
  }
  uVar6 = 1;
LAB_00763331:
  iVar8 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar7 = ThreadGetCurrentId(), iVar8 == iVar7)) {
    cVar3 = CVProfNode::ExitScope();
    if (cVar3 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_38 != 0) {
    (**(code **)(local_38 + 0x54))(local_38,local_40,local_3c,0,0,0);
  }
  return uVar6;
}

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)