L L4D2node

CBaseAnimating::CalculateIKLocks

0x005de970 · 1803 bytes · __cdecl

_ZN14CBaseAnimating16CalculateIKLocksEf

Decompiled

undefined (1 param)

/* CBaseAnimating::CalculateIKLocks(float) */

void CBaseAnimating::CalculateIKLocks(float param_1)

{
  float fVar1;
  bool bVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  CIKTarget *this;
  int iVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  float fVar18;
  float local_e8;
  float local_e4;
  float local_e0;
  undefined **local_dc [4];
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  float local_9c;
  float local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  CGameTrace local_70 [12];
  float local_64;
  float local_60;
  float local_5c;
  Vector local_58 [31];
  char local_39;
  
  if (*(int *)((int)param_1 + 0x480) != 0) {
    CTraceFilterSimple::CTraceFilterSimple
              ((CTraceFilterSimple *)local_dc,(IHandleEntity *)param_1,
               *(int *)((int)param_1 + 0x234),(_func_bool_IHandleEntity_ptr_int *)0x0);
    local_dc[0] = &PTR_ShouldHitEntity_00c5a8f8;
    (**(code **)(*(int *)param_1 + 0x24c))(param_1,0,0,&local_e8);
    iVar4 = *(int *)((int)param_1 + 0x480);
    if (0 < *(int *)(iVar4 + 0xff0)) {
      iVar6 = 0;
      do {
        this = (CIKTarget *)(iVar6 * 0x154 + iVar4);
        cVar3 = CIKTarget::IsActive(this);
        if ((cVar3 != '\0') && (*(int *)(this + 4) == 3)) {
          uVar5 = 0;
          if ((*(uint *)((int)param_1 + 0x14c) & 0x800) != 0) {
            CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
            uVar5 = *(uint *)((int)param_1 + 0x14c) & 0x800;
          }
          fVar8 = *(float *)((int)param_1 + 0x2e0);
          fVar11 = local_e8 * local_e8;
          fVar7 = *(float *)(this + 0x60) - fVar8;
          fVar17 = *(float *)((int)param_1 + 0x2e4);
          fVar18 = *(float *)(this + 100) - fVar17;
          fVar10 = *(float *)((int)param_1 + 0x2e8);
          fVar12 = local_e4 * local_e4;
          fVar9 = *(float *)(this + 0x68) - fVar10;
          fVar13 = local_e0 * local_e0;
          fVar14 = *(float *)(this + 0x50) * local_e8;
          fVar15 = *(float *)(this + 0x50) * local_e4;
          fVar16 = *(float *)(this + 0x50) * local_e0;
          if (uVar5 != 0) {
            CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
            fVar8 = *(float *)((int)param_1 + 0x2e0);
            fVar17 = *(float *)((int)param_1 + 0x2e4);
            fVar10 = *(float *)((int)param_1 + 0x2e8);
          }
          local_8c = 0;
          local_94 = 0x3f000000;
          fVar1 = *(float *)(this + 0x4c);
          fVar8 = ((fVar7 + fVar14) - fVar11 * fVar7) + fVar8;
          fVar10 = ((fVar9 + fVar16) - fVar13 * fVar9) + fVar10;
          fVar17 = ((fVar15 + fVar18) - fVar12 * fVar18) + fVar17;
          local_cc = local_e8 * fVar1 + fVar8;
          fVar7 = 1.0;
          if (1.0 <= *(float *)(this + 0x54)) {
            fVar7 = *(float *)(this + 0x54);
          }
          local_c8 = local_e4 * fVar1 + fVar17;
          fVar9 = -fVar1;
          local_c4 = local_e0 * fVar1 + fVar10;
          local_bc = (local_e8 * fVar9 + fVar8) - local_cc;
          local_b8 = (local_e4 * fVar9 + fVar17) - local_c8;
          local_b4 = (fVar9 * local_e0 + fVar10) - local_c4;
          local_c4 = local_c4 + 0.5;
          local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
          bVar2 = fVar7 * fVar7 + fVar7 * fVar7 + 0.25 < 1e-06;
          local_ac = 0;
          local_a8 = 0;
          local_a4 = 0xbf000000;
          local_9c = fVar7;
          local_98 = fVar7;
          local_88 = bVar2;
          (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x200400b,local_dc,local_70);
          if (local_39 != '\0') {
            local_cc = *(float *)(this + 0x8c);
            local_ac = 0;
            local_c8 = *(float *)(this + 0x90);
            local_a8 = 0;
            local_bc = *(float *)(this + 0x60) - local_cc;
            local_b8 = *(float *)(this + 100) - local_c8;
            local_8c = 0;
            local_b4 = *(float *)(this + 0x68) - *(float *)(this + 0x94);
            local_c4 = *(float *)(this + 0x94) + 0.5;
            local_94 = 0x3f000000;
            local_a4 = 0xbf000000;
            local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
            local_9c = fVar7;
            local_98 = fVar7;
            local_88 = bVar2;
            (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x200400b,local_dc,local_70);
            local_8c = 0;
            local_94 = 0x3f000000;
            local_b4 = -*(float *)(this + 0x4c);
            local_a4 = 0xbf000000;
            local_bc = local_e8 * local_b4;
            local_b8 = local_e4 * local_b4;
            local_b4 = local_b4 * local_e0;
            local_ac = 0;
            local_a8 = 0;
            local_c4 = local_5c + 0.5;
            local_87 = local_b4 * local_b4 + local_b8 * local_b8 + local_bc * local_bc != 0.0;
            local_cc = local_64;
            local_c8 = local_60;
            local_9c = fVar7;
            local_98 = fVar7;
            local_88 = bVar2;
            (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x200400b,local_dc,local_70);
            if (local_39 != '\0') goto LAB_005ded50;
          }
          cVar3 = CGameTrace::DidHitWorld(local_70);
          if (cVar3 == '\0') {
            CIKTarget::SetPos(this,(Vector *)&local_64);
            if ((*(byte *)((int)param_1 + 0x14d) & 8) != 0) {
              CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
            }
            CIKTarget::SetAngles(this,(QAngle *)((int)param_1 + 0x37c));
          }
          else {
            CIKTarget::SetPosWithNormalOffset(this,(Vector *)&local_64,local_58);
            CIKTarget::SetNormal(this,local_58);
          }
        }
LAB_005ded50:
        iVar4 = *(int *)((int)param_1 + 0x480);
        iVar6 = iVar6 + 1;
      } while (iVar6 < *(int *)(iVar4 + 0xff0));
    }
  }
  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)