L L4D2node

SetBodygroup

0x003fbbc0 · 79 bytes · __cdecl

_Z12SetBodygroupP10CStudioHdrRiii

Decompiled

undefined (4 params)

/* SetBodygroup(CStudioHdr*, int&, int, int) */

int SetBodygroup(CStudioHdr *param_1,int *param_2,int param_3,int param_4)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  
  iVar3 = 0;
  if ((param_1 != (CStudioHdr *)0x0) && (iVar3 = *(int *)param_1, param_3 < *(int *)(iVar3 + 0xe8)))
  {
    iVar4 = param_3 * 0x10 + *(int *)(iVar3 + 0xec) + iVar3;
    iVar1 = *(int *)(iVar4 + 4);
    if (param_4 < iVar1) {
      iVar4 = *(int *)(iVar4 + 8);
      iVar2 = *param_2 / iVar4;
      iVar3 = iVar2 / iVar1;
      *param_2 = (*param_2 - (iVar2 % iVar1) * iVar4) + iVar4 * param_4;
    }
  }
  return iVar3;
}

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)