CWorkshop::AddItem
0x0023d640 · 317 bytes · __cdecl
_ZN9CWorkshop7AddItemEy
Decompiled
undefined (1 param)
/* CWorkshop::AddItem(unsigned long long) */
void CWorkshop::AddItem(ulonglong param_1)
{
int iVar1;
undefined4 *puVar2;
int *piVar3;
int in_stack_0000000c;
int local_24;
int local_20;
local_24 = param_1._4_4_;
local_20 = in_stack_0000000c;
if (0 < ((int *)param_1)[0x38]) {
piVar3 = (int *)((int *)param_1)[0x35];
if (piVar3[1] == in_stack_0000000c && *piVar3 == param_1._4_4_) {
return;
}
iVar1 = 0;
do {
iVar1 = iVar1 + 1;
if (iVar1 == ((int *)param_1)[0x38]) goto LAB_0023d6a3;
} while (piVar3[iVar1 * 2 + 1] != in_stack_0000000c || piVar3[iVar1 * 2] != param_1._4_4_);
if (iVar1 != -1) {
return;
}
}
LAB_0023d6a3:
if (0 < ((int *)param_1)[0x42]) {
piVar3 = (int *)((int *)param_1)[0x3f];
if (piVar3[1] == in_stack_0000000c && *piVar3 == param_1._4_4_) {
return;
}
iVar1 = 0;
do {
iVar1 = iVar1 + 1;
if (iVar1 == ((int *)param_1)[0x42]) goto LAB_0023d6fb;
} while (piVar3[iVar1 * 2 + 1] != in_stack_0000000c || piVar3[iVar1 * 2] != param_1._4_4_);
if (iVar1 != -1) {
return;
}
}
LAB_0023d6fb:
puVar2 = operator_new(0xc);
*puVar2 = &PTR_OnError_002cac70;
puVar2[1] = local_24;
puVar2[2] = local_20;
piVar3 = (int *)(**(code **)(*(int *)param_1 + 0x14))((int *)param_1);
(**(code **)(*piVar3 + 8))(piVar3,puVar2,1);
CUtlVector<unsigned_long_long,CUtlMemory<unsigned_long_long,int>>::InsertBefore
((CUtlVector<unsigned_long_long,CUtlMemory<unsigned_long_long,int>> *)
((int *)param_1 + 0x35),((int *)param_1)[0x38],(ulonglong *)&local_24);
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.