CAmmoDef::AddAmmoType
0x003fa5f0 · 440 bytes · __thiscall
_ZN8CAmmoDef11AddAmmoTypeEPKciiS1_S1_S1_fiii
Decompiled
undefined (11 params)
/* CAmmoDef::AddAmmoType(char const*, int, int, char const*, char const*, char const*, float, int,
int, int) */
void __thiscall
CAmmoDef::AddAmmoType
(CAmmoDef *this,char *param_1,int param_2,int param_3,char *param_4,char *param_5,
char *param_6,float param_7,int param_8,int param_9,int param_10)
{
char cVar1;
undefined4 uVar2;
int iVar3;
cVar1 = AddAmmoType(this,param_1,param_2,param_3,param_8,param_9,param_10);
if (cVar1 != '\0') {
iVar3 = *(int *)(this + 4);
if (param_4 != (char *)0x0) {
uVar2 = (**(code **)(*cvar + 0x30))(cvar,param_4);
*(undefined4 *)(this + iVar3 * 0x34 + 0x30) = uVar2;
iVar3 = *(int *)(this + 4);
if (*(int *)(this + iVar3 * 0x34 + 0x30) == 0) {
Msg("ERROR: Ammo (%s) found no CVar named (%s)\n",param_1,param_4);
iVar3 = *(int *)(this + 4);
}
*(undefined4 *)(this + iVar3 * 0x34 + 0x24) = 0xffffffff;
}
if (param_5 != (char *)0x0) {
uVar2 = (**(code **)(*cvar + 0x30))(cvar,param_5);
*(undefined4 *)(this + iVar3 * 0x34 + 0x34) = uVar2;
iVar3 = *(int *)(this + 4);
if (*(int *)(this + iVar3 * 0x34 + 0x34) == 0) {
Msg("ERROR: Ammo (%s) found no CVar named (%s)\n",param_1,param_5);
iVar3 = *(int *)(this + 4);
}
*(undefined4 *)(this + iVar3 * 0x34 + 0x28) = 0xffffffff;
}
if (param_6 != (char *)0x0) {
uVar2 = (**(code **)(*cvar + 0x30))(cvar,param_6);
*(undefined4 *)(this + iVar3 * 0x34 + 0x38) = uVar2;
iVar3 = *(int *)(this + 4);
if (*(int *)(this + iVar3 * 0x34 + 0x38) == 0) {
Msg("ERROR: Ammo (%s) found no CVar named (%s)\n",param_1,param_6);
iVar3 = *(int *)(this + 4);
}
*(undefined4 *)(this + iVar3 * 0x34 + 0x2c) = 0xffffffff;
}
*(float *)(this + iVar3 * 0x34 + 0x14) = param_7;
*(int *)(this + 4) = iVar3 + 1;
}
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.