L L4D2node

CBasePlayerAnimState::OnNewModel

0x0041dcd0 · 335 bytes · __thiscall

_ZN20CBasePlayerAnimState10OnNewModelEv

Decompiled

undefined (1 param)

/* CBasePlayerAnimState::OnNewModel() */

void __thiscall CBasePlayerAnimState::OnNewModel(CBasePlayerAnimState *this)

{
  CBaseEntity *this_00;
  int iVar1;
  undefined4 uVar2;
  CBasePlayerAnimState *pCVar3;
  int iVar4;
  longdouble lVar5;
  CStudioHdr *local_20;
  
  if (*(int *)(this + 0x18) != 0) {
    this_00 = *(CBaseEntity **)(this + 0x14);
    local_20 = *(CStudioHdr **)(this_00 + 0x13e0);
    if (local_20 == (CStudioHdr *)0x0) {
      iVar4 = CBaseEntity::GetModel(this_00);
      if (iVar4 == 0) {
        local_20 = *(CStudioHdr **)(this_00 + 0x13e0);
      }
      else {
        CBaseAnimating::LockStudioHdr((CBaseAnimating *)this_00);
        local_20 = *(CStudioHdr **)(this_00 + 0x13e0);
      }
      if (local_20 == (CStudioHdr *)0x0) goto LAB_0041dd4e;
    }
    if (*(int *)local_20 != 0) {
      iVar4 = 0;
      pCVar3 = this;
      do {
        uVar2 = CBaseFlex::FindFlexController
                          (*(CBaseFlex **)(this + 0x18),(&s_flexToPose)[iVar4 * 2]);
        *(undefined4 *)(pCVar3 + 0xac) = uVar2;
        iVar1 = iVar4 * 2;
        iVar4 = iVar4 + 1;
        uVar2 = CBaseAnimating::LookupPoseParameter
                          (*(CBaseAnimating **)(this + 0x18),local_20,
                           (&PTR_s_jaw_controller_00c0b804)[iVar1]);
        *(undefined4 *)(pCVar3 + 0xbc) = uVar2;
        pCVar3 = pCVar3 + 4;
      } while (iVar4 != 4);
    }
  }
LAB_0041dd4e:
  lVar5 = (longdouble)CountdownTimer::Now();
  if ((float)lVar5 + 1.0 != *(float *)(this + 0x2c)) {
    (**(code **)(*(int *)(this + 0x24) + 4))(this + 0x24,this + 0x2c);
    *(float *)(this + 0x2c) = (float)lVar5 + 1.0;
  }
  if (*(float *)(this + 0x28) != 1.0) {
    (**(code **)(*(int *)(this + 0x24) + 4))(this + 0x24,this + 0x28);
    *(undefined4 *)(this + 0x28) = 0x3f800000;
  }
  (**(code **)(*(int *)this + 0x5c))(this);
  (**(code **)(*(int *)this + 0xc))(this);
  *(undefined4 *)(this + 0xd8) = 0;
  *(undefined4 *)(this + 0xec) = 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)