L L4D2node

CBoneFollowerManager::CreatePhysicsFollower

0x007866e0 · 1028 bytes · __thiscall

_ZN20CBoneFollowerManager21CreatePhysicsFollowerEP14CBaseAnimatingR14physfollower_tPKcP7solid_t

Decompiled

undefined (5 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBoneFollowerManager::CreatePhysicsFollower(CBaseAnimating*, physfollower_t&, char const*,
   solid_t*) */

undefined4 __thiscall
CBoneFollowerManager::CreatePhysicsFollower
          (CBoneFollowerManager *this,CBaseAnimating *param_1,physfollower_t *param_2,char *param_3,
          solid_t *param_4)

{
  int iVar1;
  uint uVar2;
  int *piVar3;
  bool bVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  int *piVar8;
  undefined4 *puVar9;
  int iVar10;
  undefined4 uVar11;
  CStudioHdr *pCVar12;
  undefined *puVar13;
  CBaseEntity *this_00;
  undefined1 *puVar14;
  CStudioHdr *pCVar15;
  int in_GS_OFFSET;
  char *local_6b0;
  undefined4 local_6a8;
  undefined4 local_6a4;
  undefined4 local_6a0;
  QAngle local_69c [12];
  matrix3x4_t local_690 [12];
  undefined4 local_684;
  undefined4 local_674;
  undefined4 local_664;
  solid_t local_660 [1600];
  int local_20;
  
  puVar14 = &stack0xfffff924;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pCVar12 = *(CStudioHdr **)(param_1 + 0x13e0);
  if (pCVar12 == (CStudioHdr *)0x0) {
    iVar5 = CBaseEntity::GetModel((CBaseEntity *)param_1);
    if (iVar5 == 0) {
      pCVar12 = *(CStudioHdr **)(param_1 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(param_1);
      pCVar12 = *(CStudioHdr **)(param_1 + 0x13e0);
    }
    pCVar15 = (CStudioHdr *)0x0;
    if (pCVar12 != (CStudioHdr *)0x0) goto LAB_0078671e;
  }
  else {
LAB_0078671e:
    pCVar15 = (CStudioHdr *)0x0;
    if (*(int *)pCVar12 != 0) {
      pCVar15 = pCVar12;
    }
  }
  iVar5 = Studio_BoneIndexByName(pCVar15,param_3);
  if (iVar5 < 0) {
    Warning();
    uVar11 = 0;
    goto LAB_007869af;
  }
  iVar1 = *(int *)(*(int *)pCVar15 + 0xac + iVar5 * 0xd8 + *(int *)(*(int *)pCVar15 + 0xa0));
  if (param_4 == (solid_t *)0x0) {
    param_4 = local_660;
    iVar6 = (**(code **)(*(int *)param_1 + 0x1c))();
    uVar11 = PhysModelParseSolidByIndex(param_4,(CBaseEntity *)param_1,iVar6,iVar1);
    puVar14 = &stack0xfffff924;
    if ((char)uVar11 == '\0') goto LAB_007869af;
  }
  iVar6 = Studio_BoneIndexByName(pCVar15,(char *)param_4);
  if (iVar6 < 0) {
    *(int *)param_2 = iVar5;
  }
  else {
    *(int *)param_2 = iVar6;
  }
  (**(code **)(*(int *)param_1 + 0x358))();
  MatrixAngles(local_690,(float *)local_69c);
  local_6a8 = local_684;
  local_6a4 = local_674;
  local_6a0 = local_664;
  (**(code **)(*(int *)param_1 + 0x20))();
  pcVar7 = "";
  if (local_6b0 != (char *)0x0) {
    pcVar7 = local_6b0;
  }
  piVar8 = (int *)CBoneFollower::Create
                            ((CBaseEntity *)param_1,pcVar7,param_4,(Vector *)&local_6a8,local_69c);
  if (piVar8 == (int *)0x0) {
    *(undefined4 *)(param_2 + 4) = 0xffffffff;
  }
  else {
    puVar9 = (undefined4 *)(**(code **)(*piVar8 + 0xc))();
    *(undefined4 *)(param_2 + 4) = *puVar9;
  }
  piVar8 = *(int **)(param_1 + 0x13e0);
  if (piVar8 == (int *)0x0) {
    iVar5 = CBaseEntity::GetModel((CBaseEntity *)param_1);
    if (iVar5 == 0) {
      piVar8 = *(int **)(param_1 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(param_1);
      piVar8 = *(int **)(param_1 + 0x13e0);
    }
    if (piVar8 != (int *)0x0) goto LAB_00786861;
LAB_00786aea:
    iVar5 = _DAT_00000000;
  }
  else {
LAB_00786861:
    iVar5 = *piVar8;
    if (*piVar8 == 0) goto LAB_00786aea;
  }
  iVar6 = *(int *)(iVar5 + 0xb0) + *(int *)(param_1 + 0x460) * 0xc + iVar5;
  if (*(int *)(iVar6 + 4) < 1) {
LAB_00786911:
    iVar5 = 0;
  }
  else {
    piVar8 = (int *)(*(int *)(iVar6 + 8) + iVar6);
    if (iVar1 != *(int *)(iVar5 + 0xac + *piVar8 * 0xd8 + *(int *)(iVar5 + 0xa0))) {
      iVar10 = 0;
      piVar3 = (int *)(iVar6 + 0x44 + *(int *)(iVar6 + 8));
      do {
        piVar8 = piVar3;
        iVar10 = iVar10 + 1;
        if (iVar10 == *(int *)(iVar6 + 4)) goto LAB_00786911;
        piVar3 = piVar8 + 0x11;
      } while (iVar1 != *(int *)(iVar5 + 0xac + *piVar8 * 0xd8 + *(int *)(iVar5 + 0xa0)));
    }
    iVar5 = piVar8[1];
  }
  iVar6 = 0;
  uVar2 = *(uint *)(param_2 + 4);
  if (((uVar2 != 0xffffffff) &&
      (puVar13 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar13 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar13 + 8) == uVar2 >> 0xc)) {
    iVar6 = *(int *)(puVar13 + 4);
  }
  *(int *)(iVar6 + 0x44c) = iVar5;
  *(int *)(iVar6 + 0x448) = iVar1;
  bVar4 = (bool)CBaseEntity::BlocksLOS((CBaseEntity *)param_1);
  uVar2 = *(uint *)(param_2 + 4);
  if (((uVar2 == 0xffffffff) ||
      (puVar13 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar13 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar13 + 8) != uVar2 >> 0xc)) {
    this_00 = (CBaseEntity *)0x0;
  }
  else {
    this_00 = *(CBaseEntity **)(puVar13 + 4);
  }
  CBaseEntity::SetBlocksLOS(this_00,bVar4);
  uVar11 = 1;
  puVar14 = &stack0xfffff920;
LAB_007869af:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    *(undefined **)(puVar14 + -4) = &UNK_00786b16;
    __stack_chk_fail();
  }
  return uVar11;
}

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)