CGib::SpawnSpecificGibs
0x006d6120 · 184 bytes · __cdecl
_ZN4CGib17SpawnSpecificGibsEP11CBaseEntityiffPKcf
Decompiled
undefined (6 params)
/* CGib::SpawnSpecificGibs(CBaseEntity*, int, float, float, char const*, float) */
void CGib::SpawnSpecificGibs
(CBaseEntity *param_1,int param_2,float param_3,float param_4,char *param_5,
float param_6)
{
CBaseEdict *this;
int iVar1;
CGib *this_00;
int iVar2;
CGib *in_stack_ffffffd4;
CBaseEntity *in_stack_ffffffd8;
iVar2 = 0;
if (0 < param_2) {
do {
this_00 = _CreateEntity<CGib>(in_stack_ffffffd4,(char *)in_stack_ffffffd8);
Spawn(this_00,param_5);
if (iVar2 != *(int *)(this_00 + 0x45c)) {
if (this_00[0x6c] == (CGib)0x0) {
this = *(CBaseEdict **)(this_00 + 0x30);
if (this != (CBaseEdict *)0x0) {
*(uint *)this = *(uint *)this | 0x101;
iVar1 = CBaseEdict::GetChangeAccessor(this);
*(undefined2 *)(iVar1 + 2) = 0;
}
}
else {
this_00[0x70] = (CGib)((byte)this_00[0x70] | 1);
}
*(int *)(this_00 + 0x45c) = iVar2;
}
in_stack_ffffffd4 = this_00;
in_stack_ffffffd8 = param_1;
InitGib(this_00,param_1,param_3,param_4);
*(float *)(this_00 + 0x1400) = param_6;
if (param_1 != (CBaseEntity *)0x0) {
in_stack_ffffffd8 = param_1;
(**(code **)(*(int *)this_00 + 0x50))();
in_stack_ffffffd4 = this_00;
}
iVar2 = iVar2 + 1;
} while (iVar2 != param_2);
}
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.