L L4D2node

FindPhysicsAnchor

0x007748c0 · 773 bytes · __cdecl

_Z17FindPhysicsAnchor8string_tR20hl_constraint_info_tiP11CBaseEntity

Decompiled

undefined (4 params)

/* FindPhysicsAnchor(string_t, hl_constraint_info_t&, int, CBaseEntity*) */

void FindPhysicsAnchor(char *param_1,int param_2,int param_3,CBaseEntity *param_4)

{
  undefined4 *puVar1;
  uint uVar2;
  char *pcVar3;
  int iVar4;
  char *pcVar5;
  undefined4 uVar6;
  CBaseAnimating *this;
  int iVar7;
  undefined4 *puVar8;
  undefined *puVar9;
  undefined *puVar10;
  int *piVar11;
  int iVar12;
  int local_1030;
  Vector local_1028 [12];
  undefined4 local_101c [1027];
  
  local_1030 = g_AnchorList._24_4_ + -1;
  if (-1 < local_1030) {
    iVar12 = local_1030 * 0x1c;
    do {
      pcVar5 = "";
      if (param_1 != (char *)0x0) {
        pcVar5 = param_1;
      }
      puVar8 = (undefined4 *)(g_AnchorList._12_4_ + iVar12);
      pcVar3 = (char *)puVar8[5];
      if (pcVar3 == (char *)0x0) {
        pcVar3 = "";
      }
      if (pcVar5 == pcVar3) {
LAB_00774929:
        puVar9 = g_pEntityList;
        uVar2 = puVar8[3];
        if ((((uVar2 != 0xffffffff) &&
             (puVar10 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
            && (*(uint *)(puVar10 + 8) == uVar2 >> 0xc)) && (*(int *)(puVar10 + 4) != 0)) {
          iVar12 = param_2 + param_3 * 4;
          *(undefined4 *)(iVar12 + 0x24) = puVar8[6];
          if (0 < (int)puVar8[4]) {
            uVar2 = puVar8[3];
            piVar11 = (int *)0x0;
            if (((uVar2 != 0xffffffff) &&
                (puVar9 = puVar9 + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
               (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
              piVar11 = *(int **)(puVar9 + 4);
            }
            this = (CBaseAnimating *)(**(code **)(*piVar11 + 0xf0))(piVar11);
            if (this != (CBaseAnimating *)0x0) {
              uVar2 = puVar8[3];
              piVar11 = (int *)0x0;
              if (((uVar2 != 0xffffffff) &&
                  (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10,
                  puVar9 != (undefined *)0xfffffffc)) && (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
                piVar11 = *(int **)(puVar9 + 4);
              }
              iVar4 = (**(code **)(*piVar11 + 0x2b8))(piVar11,local_101c,0x400);
              iVar7 = CBaseAnimating::GetAttachmentBone(this,puVar8[4]);
              iVar7 = CBaseAnimating::GetPhysicsBone(this,iVar7);
              if (iVar7 < iVar4) {
                *(undefined4 *)(iVar12 + 0x18) = local_101c[iVar7];
                CBaseAnimating::GetAttachment
                          (this,puVar8[4],local_1028,(Vector *)0x0,(Vector *)0x0,(Vector *)0x0);
                (**(code **)(*(int *)local_101c[iVar7] + 0xe8))
                          ((int *)local_101c[iVar7],param_2 + param_3 * 0xc,local_1028);
                return;
              }
            }
          }
          iVar4 = 0;
          puVar1 = (undefined4 *)(param_2 + param_3 * 0xc);
          *puVar1 = *puVar8;
          puVar9 = g_pEntityList;
          puVar1[1] = puVar8[1];
          puVar1[2] = puVar8[2];
          uVar2 = puVar8[3];
          if (((uVar2 != 0xffffffff) &&
              (puVar9 = puVar9 + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
             (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
            iVar4 = *(int *)(puVar9 + 4);
          }
          *(undefined4 *)(iVar12 + 0x18) = *(undefined4 *)(iVar4 + 0x238);
          return;
        }
        break;
      }
      iVar4 = _V_stricmp(pcVar3,pcVar5);
      if (iVar4 == 0) {
        puVar8 = (undefined4 *)(iVar12 + g_AnchorList._12_4_);
        if (puVar8 != (undefined4 *)0x0) goto LAB_00774929;
        break;
      }
      local_1030 = local_1030 + -1;
      iVar12 = iVar12 + -0x1c;
    } while (local_1030 != -1);
  }
  puVar8 = (undefined4 *)(param_2 + param_3 * 0xc);
  *puVar8 = vec3_origin;
  puVar8[1] = DAT_01053d4c;
  puVar8[2] = DAT_01053d50;
  pcVar5 = "";
  if (param_1 != (char *)0x0) {
    pcVar5 = param_1;
  }
  uVar6 = FindPhysicsObjectByName(pcVar5,param_4);
  param_2 = param_2 + param_3 * 4;
  *(undefined4 *)(param_2 + 0x18) = uVar6;
  *(undefined4 *)(param_2 + 0x24) = 0x3f800000;
  return;
}

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)