L L4D2node

CIKContext::AddSequenceLocks

0x00b8a1c0 · 713 bytes · __thiscall

_ZN10CIKContext16AddSequenceLocksER16mstudioseqdesc_tP6VectorP10Quaternion

Decompiled

undefined (4 params)

/* CIKContext::AddSequenceLocks(mstudioseqdesc_t&, Vector*, Quaternion*) */

void __thiscall
CIKContext::AddSequenceLocks
          (CIKContext *this,mstudioseqdesc_t *param_1,Vector *param_2,Quaternion *param_3)

{
  CStudioHdr *pCVar1;
  matrix3x4_t *pmVar2;
  char cVar3;
  matrix3x4_t *pmVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int *piVar8;
  int iVar9;
  int local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if ((*(int *)(**(int **)(this + 0xff8) + 0x11c) == 0) || (*(int *)(param_1 + 0xa4) == 0)) {
    return;
  }
  do {
    pmVar4 = g_MatrixPool;
    if (g_MatrixPool == (matrix3x4_t *)0x0) {
      pmVar4 = (matrix3x4_t *)memalign(0x10,0x1800);
      if (((uint)pmVar4 & 0xf) != 0) {
        raise(5);
      }
      break;
    }
    cVar3 = ThreadInterlockedAssignIf64
                      (&g_MatrixPool,*(undefined4 *)g_MatrixPool,DAT_01047874 + -1,g_MatrixPool,
                       DAT_01047874);
  } while (cVar3 == '\0');
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  iVar9 = *(int *)(param_1 + 0xa4);
  local_30 = *(int *)(this + 0x101c);
  iVar6 = 0;
  if (iVar9 != 0) {
    CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>>::GrowVector
              ((CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>> *)(this + 0x1010),
               iVar9);
    CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>>::ShiftElementsRight
              ((CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>> *)(this + 0x1010),
               local_30,iVar9);
    iVar6 = *(int *)(param_1 + 0xa4);
  }
  local_30 = local_30 * 0x84;
  iVar9 = 0;
  memset((void *)(*(int *)(this + 0x1010) + local_30),0,iVar6 * 0x84);
  if (0 < *(int *)(param_1 + 0xa4)) {
    do {
      pCVar1 = *(CStudioHdr **)(this + 0xff8);
      iVar7 = *(int *)pCVar1 +
              *(int *)(param_1 + iVar9 * 0x20 + *(int *)(param_1 + 0xa8)) * 0x10 +
              *(int *)(*(int *)pCVar1 + 0x120);
      iVar6 = *(int *)(iVar7 + 0x38 + *(int *)(iVar7 + 0xc));
      if ((*(uint *)(this + 0x105c) & *(uint *)(*(int *)(pCVar1 + 0x2c) + iVar6 * 4)) != 0) {
        ::BuildBoneChain(pCVar1,(matrix3x4_t *)(this + 0x1024),param_2,param_3,iVar6,pmVar4,
                         (CBoneBitList *)&local_2c);
        iVar5 = local_30 + *(int *)(this + 0x1010);
        *(int *)(iVar5 + 8) = iVar9;
        *(int *)(iVar5 + 0x10) = iVar9;
        *(undefined4 *)(iVar5 + 4) = 2;
        MatrixAngles(pmVar4 + iVar6 * 0x30,(Quaternion *)(iVar5 + 0x2c),(Vector *)(iVar5 + 0x20));
        piVar8 = (int *)(iVar7 + *(int *)(iVar7 + 0xc));
        if ((float)piVar8[1] * (float)piVar8[1] + (float)piVar8[3] * (float)piVar8[3] +
            (float)piVar8[2] * (float)piVar8[2] <= 0.0) {
          *(undefined4 *)(iVar5 + 0x6c) = 0;
          *(undefined4 *)(iVar5 + 0x70) = 0;
          *(undefined4 *)(iVar5 + 0x74) = 0;
        }
        else {
          VectorRotate((float *)(piVar8 + 1),pmVar4 + *piVar8 * 0x30,(float *)(iVar5 + 0x6c));
        }
      }
      iVar9 = iVar9 + 1;
      local_30 = local_30 + 0x84;
    } while (iVar9 < *(int *)(param_1 + 0xa4));
  }
  do {
    iVar9 = DAT_01047874;
    pmVar2 = g_MatrixPool;
    iVar6 = DAT_01047874 + 0x10001;
    *(matrix3x4_t **)pmVar4 = g_MatrixPool;
    cVar3 = ThreadInterlockedAssignIf64(&g_MatrixPool,pmVar4,iVar6,pmVar2,iVar9);
  } while (cVar3 == '\0');
  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)