L L4D2node

CPoseController::SetCurrentPose

0x00496390 · 309 bytes · __thiscall

_ZN15CPoseController14SetCurrentPoseEf

Decompiled

undefined (2 params)

/* CPoseController::SetCurrentPose(float) */

void __thiscall CPoseController::SetCurrentPose(CPoseController *this,float param_1)

{
  CPoseController CVar1;
  uint uVar2;
  CBaseAnimating *this_00;
  int iVar3;
  CStudioHdr *pCVar4;
  CStudioHdr *pCVar5;
  undefined *puVar6;
  int iVar7;
  CPoseController *pCVar8;
  float fVar9;
  float local_24;
  float local_20 [4];
  
  iVar7 = 0;
  pCVar8 = this + 0x450;
  do {
    uVar2 = *(uint *)(this + iVar7 * 4 + 0x440);
    if ((((uVar2 != 0xffffffff) &&
         (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) &&
       ((*(int *)(puVar6 + 4) != 0 &&
        (this_00 = (CBaseAnimating *)
                   __dynamic_cast(*(int *)(puVar6 + 4),&CBaseEntity::typeinfo,
                                  &CBaseAnimating::typeinfo,0), this_00 != (CBaseAnimating *)0x0))))
    {
      CBaseAnimating::GetPoseParameterRange(this_00,(uint)(byte)*pCVar8,&local_24,local_20);
      pCVar4 = *(CStudioHdr **)(this_00 + 0x13e0);
      CVar1 = *pCVar8;
      fVar9 = (local_20[0] - local_24) * param_1 + local_24;
      if (pCVar4 == (CStudioHdr *)0x0) {
        iVar3 = CBaseEntity::GetModel((CBaseEntity *)this_00);
        if (iVar3 == 0) {
          pCVar4 = *(CStudioHdr **)(this_00 + 0x13e0);
        }
        else {
          CBaseAnimating::LockStudioHdr(this_00);
          pCVar4 = *(CStudioHdr **)(this_00 + 0x13e0);
        }
        pCVar5 = (CStudioHdr *)0x0;
        if (pCVar4 != (CStudioHdr *)0x0) goto LAB_0049645e;
      }
      else {
LAB_0049645e:
        pCVar5 = (CStudioHdr *)0x0;
        if (*(int *)pCVar4 != 0) {
          pCVar5 = pCVar4;
        }
      }
      CBaseAnimating::SetPoseParameter(this_00,pCVar5,(uint)(byte)CVar1,fVar9);
    }
    iVar7 = iVar7 + 1;
    pCVar8 = pCVar8 + 1;
    if (iVar7 == 4) {
      return;
    }
  } while( true );
}

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)