L L4D2node

Path::GetCursorData

0x0075e8e0 · 1009 bytes · __thiscall

_ZNK4Path13GetCursorDataEv

Decompiled

undefined (1 param)

/* Path::GetCursorData() const */

Path * __thiscall Path::GetCursorData(Path *this)

{
  undefined4 uVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  int iVar8;
  char cVar9;
  Path *pPVar10;
  Path *pPVar11;
  longdouble lVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float local_20;
  
  cVar9 = (**(code **)(*(int *)this + 0x44))(this);
  uVar1 = vec3_origin;
  if (cVar9 == '\0') {
    *(undefined4 *)(this + 0x4430) = 0x3f800000;
    *(undefined4 *)(this + 0x4434) = 0;
    *(undefined4 *)(this + 0x4424) = uVar1;
    uVar1 = DAT_01053d4c;
    *(undefined4 *)(this + 0x4438) = 0;
    *(undefined4 *)(this + 0x4428) = uVar1;
    uVar1 = DAT_01053d50;
    *(undefined4 *)(this + 0x443c) = 0;
    *(undefined4 *)(this + 0x442c) = uVar1;
    *(undefined4 *)(this + 0x4440) = 0;
    return this + 0x4424;
  }
  if (this[0x4444] != (Path)0x0) {
    fVar14 = *(float *)(this + 0x4420);
    if ((fVar14 < 0.0001) || (*(int *)(this + 0x4404) < 2)) {
      *(Path **)(this + 0x4440) = this + 4;
      *(undefined4 *)(this + 0x4424) = *(undefined4 *)(this + 0xc);
      *(undefined4 *)(this + 0x4428) = *(undefined4 *)(this + 0x10);
      *(undefined4 *)(this + 0x442c) = *(undefined4 *)(this + 0x14);
      *(undefined4 *)(this + 0x4430) = *(undefined4 *)(this + 0x20);
      *(undefined4 *)(this + 0x4434) = *(undefined4 *)(this + 0x24);
      *(undefined4 *)(this + 0x4438) = *(undefined4 *)(this + 0x28);
      *(undefined4 *)(this + 0x443c) = *(undefined4 *)(this + 0x34);
    }
    else {
      lVar12 = (longdouble)(**(code **)(*(int *)this + 8))(this);
      if (fVar14 <= (float)lVar12 - 0.0001) {
        pPVar11 = this + 4;
        pPVar10 = (Path *)(**(code **)(*(int *)this + 0x58))(this,pPVar11);
        if (pPVar10 != (Path *)0x0) {
          fVar14 = *(float *)(this + 0x2c);
          fVar13 = *(float *)(this + 0x4420);
          fVar15 = fVar14;
          if (fVar14 < fVar13) {
            do {
              local_20 = fVar15;
              pPVar11 = pPVar10;
              pPVar10 = (Path *)(**(code **)(*(int *)this + 0x58))(this,pPVar11);
              if (pPVar10 == (Path *)0x0) goto LAB_0075ea44;
              fVar14 = *(float *)(pPVar11 + 0x28);
              fVar13 = *(float *)(this + 0x4420);
              fVar15 = local_20 + fVar14;
            } while (local_20 + fVar14 < fVar13);
          }
          else {
            local_20 = 0.0;
          }
          uVar1 = NextBotPathSegmentInfluenceRadius._28_4_;
          fVar15 = 1.0;
          fVar13 = fVar13 - local_20;
          if (0.0 < fVar14) {
            fVar15 = fVar13 / fVar14;
          }
          fVar2 = *(float *)(pPVar11 + 0x10);
          fVar3 = *(float *)(pPVar11 + 8);
          fVar4 = *(float *)(pPVar10 + 0x10);
          fVar5 = *(float *)(pPVar10 + 8);
          *(float *)(this + 0x4428) =
               (*(float *)(pPVar10 + 0xc) - *(float *)(pPVar11 + 0xc)) * fVar15 +
               *(float *)(pPVar11 + 0xc);
          *(float *)(this + 0x442c) = (fVar4 - fVar2) * fVar15 + fVar2;
          *(float *)(this + 0x4424) = (fVar5 - fVar3) * fVar15 + fVar3;
          fVar2 = *(float *)(pPVar11 + 0x20);
          fVar3 = *(float *)(pPVar10 + 0x20);
          fVar4 = *(float *)(pPVar11 + 0x24);
          fVar5 = *(float *)(pPVar11 + 0x1c);
          fVar6 = *(float *)(pPVar10 + 0x24);
          fVar7 = *(float *)(pPVar10 + 0x1c);
          *(Path **)(this + 0x4440) = pPVar11;
          *(float *)(this + 0x4434) = (fVar3 - fVar2) * fVar15 + fVar2;
          *(float *)(this + 0x4438) = (fVar6 - fVar4) * fVar15 + fVar4;
          *(float *)(this + 0x4430) = (fVar7 - fVar5) * fVar15 + fVar5;
          fVar15 = *(float *)(uVar1 + 0x2c);
          if (fVar15 <= fVar13) {
            if (fVar14 - fVar13 < fVar15) {
              *(float *)(this + 0x443c) =
                   ((fVar13 - fVar14) / fVar15 + 1.0) * *(float *)(pPVar10 + 0x30);
            }
          }
          else if (fVar15 <= fVar14 - fVar13) {
            *(float *)(this + 0x443c) = (1.0 - fVar13 / fVar15) * *(float *)(pPVar11 + 0x30);
          }
          else {
            *(float *)(this + 0x443c) =
                 (((fVar13 - fVar14) / fVar15 + 1.0) * *(float *)(pPVar10 + 0x30) +
                 *(float *)(pPVar11 + 0x30) * (1.0 - fVar13 / fVar15)) * 0.5;
          }
        }
      }
      else {
        iVar8 = (*(int *)(this + 0x4404) + -2) * 0x44;
        *(undefined4 *)(this + 0x4424) = *(undefined4 *)(this + iVar8 + 0xc);
        *(undefined4 *)(this + 0x4428) = *(undefined4 *)(this + iVar8 + 0x10);
        *(undefined4 *)(this + 0x442c) = *(undefined4 *)(this + iVar8 + 0x14);
        *(undefined4 *)(this + 0x4430) = *(undefined4 *)(this + iVar8 + 0x20);
        *(undefined4 *)(this + 0x4434) = *(undefined4 *)(this + iVar8 + 0x24);
        *(undefined4 *)(this + 0x4438) = *(undefined4 *)(this + iVar8 + 0x28);
        uVar1 = *(undefined4 *)(this + iVar8 + 0x34);
        *(Path **)(this + 0x4440) = this + iVar8 + 4;
        *(undefined4 *)(this + 0x443c) = uVar1;
      }
    }
LAB_0075ea44:
    this[0x4444] = (Path)0x0;
  }
  return this + 0x4424;
}

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)