CBaseAnimating::SetBodygroup
0x005e2720 · 196 bytes · __thiscall
_ZN14CBaseAnimating12SetBodygroupEii.part.122
Decompiled
undefined (3 params)
/* CBaseAnimating::SetBodygroup(int, int) [clone .part.122] */
void __thiscall CBaseAnimating::SetBodygroup(CBaseAnimating *this,int param_1,int param_2)
{
CBaseEdict *this_00;
CBaseEntity *in_EAX;
int iVar1;
int iVar2;
CStudioHdr *pCVar3;
int in_ECX;
int in_EDX;
CStudioHdr *pCVar4;
int local_10;
local_10 = *(int *)(in_EAX + 0x45c);
pCVar3 = *(CStudioHdr **)(in_EAX + 0x13e0);
if (pCVar3 == (CStudioHdr *)0x0) {
iVar2 = CBaseEntity::GetModel(in_EAX);
if (iVar2 == 0) {
pCVar3 = *(CStudioHdr **)(in_EAX + 0x13e0);
}
else {
LockStudioHdr((CBaseAnimating *)in_EAX);
pCVar3 = *(CStudioHdr **)(in_EAX + 0x13e0);
}
pCVar4 = (CStudioHdr *)0x0;
if (pCVar3 == (CStudioHdr *)0x0) goto LAB_005e2745;
}
pCVar4 = (CStudioHdr *)0x0;
if (*(int *)pCVar3 != 0) {
pCVar4 = pCVar3;
}
LAB_005e2745:
::SetBodygroup(pCVar4,&local_10,in_EDX,in_ECX);
iVar2 = local_10;
if (local_10 != *(int *)(in_EAX + 0x45c)) {
if (in_EAX[0x6c] == (CBaseEntity)0x0) {
this_00 = *(CBaseEdict **)(in_EAX + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar1 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar1 + 2) = 0;
}
}
else {
in_EAX[0x70] = (CBaseEntity)((byte)in_EAX[0x70] | 1);
}
*(int *)(in_EAX + 0x45c) = iVar2;
}
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.