L L4D2node

CBaseAnimating::CountBodyGroupVariants

0x005e4890 · 309 bytes · __thiscall

_ZN14CBaseAnimating22CountBodyGroupVariantsEi

Decompiled

undefined (2 params)

/* CBaseAnimating::CountBodyGroupVariants(int) */

int __thiscall CBaseAnimating::CountBodyGroupVariants(CBaseAnimating *this,int param_1)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  long lVar4;
  int iVar5;
  CStudioHdr *pCVar6;
  CStudioHdr *pCVar7;
  int iVar8;
  int local_24;
  
  pCVar6 = *(CStudioHdr **)(this + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar2 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar2 == 0) {
      pCVar6 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      LockStudioHdr(this);
      pCVar6 = *(CStudioHdr **)(this + 0x13e0);
    }
    pCVar7 = (CStudioHdr *)0x0;
    if (pCVar6 == (CStudioHdr *)0x0) goto LAB_005e48b6;
  }
  pCVar7 = (CStudioHdr *)0x0;
  if (*(int *)pCVar6 != 0) {
    pCVar7 = pCVar6;
  }
LAB_005e48b6:
  iVar2 = ::GetBodygroupCount(pCVar7,param_1);
  if (iVar2 < 1) {
    return 0;
  }
  local_24 = 0;
  iVar8 = 0;
  do {
    pCVar6 = *(CStudioHdr **)(this + 0x13e0);
    if (pCVar6 == (CStudioHdr *)0x0) {
      iVar5 = CBaseEntity::GetModel((CBaseEntity *)this);
      if (iVar5 == 0) {
        pCVar6 = *(CStudioHdr **)(this + 0x13e0);
      }
      else {
        LockStudioHdr(this);
        pCVar6 = *(CStudioHdr **)(this + 0x13e0);
      }
      pCVar7 = (CStudioHdr *)0x0;
      if (pCVar6 != (CStudioHdr *)0x0) goto LAB_005e48f2;
    }
    else {
LAB_005e48f2:
      pCVar7 = (CStudioHdr *)0x0;
      if (*(int *)pCVar6 != 0) {
        pCVar7 = pCVar6;
      }
    }
    pcVar3 = (char *)::GetBodygroupPartName(pCVar7,param_1,iVar8);
    cVar1 = *pcVar3;
    if ((cVar1 == '\0') || (lVar4 = strtol(pcVar3 + 1,(char **)0x0,10), lVar4 == -1)) {
      iVar8 = iVar8 + 1;
      if (iVar8 == iVar2) {
        return local_24;
      }
    }
    else {
      local_24 = (local_24 + 1) - (uint)(cVar1 == 'D');
      iVar8 = iVar8 + 1;
      if (iVar8 == iVar2) {
        return local_24;
      }
    }
  } 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)