CAmmoDef::AddAmmoType
0x003fa550 · 146 bytes · __thiscall
_ZN8CAmmoDef11AddAmmoTypeEPKciiiii
Decompiled
undefined (7 params)
/* CAmmoDef::AddAmmoType(char const*, int, int, int, int, int) */
bool __thiscall
CAmmoDef::AddAmmoType
(CAmmoDef *this,char *param_1,int param_2,int param_3,int param_4,int param_5,int param_6)
{
int iVar1;
int iVar2;
size_t sVar3;
void *pvVar4;
iVar1 = *(int *)(this + 4);
if (iVar1 != 0x20) {
sVar3 = strlen(param_1);
pvVar4 = operator_new__(sVar3 + 1);
*(void **)(this + iVar1 * 0x34 + 8) = pvVar4;
V_strncpy(*(char **)(this + *(int *)(this + 4) * 0x34 + 8),param_1,sVar3 + 1);
iVar2 = *(int *)(this + 4);
*(int *)(this + iVar2 * 0x34 + 0xc) = param_2;
*(int *)(this + iVar2 * 0x34 + 0x10) = param_3;
*(int *)(this + iVar2 * 0x34 + 0x18) = param_5;
*(int *)(this + iVar2 * 0x34 + 0x1c) = param_6;
*(int *)(this + iVar2 * 0x34 + 0x20) = param_4;
}
return iVar1 != 0x20;
}
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.