CEnvBeverage::Use
0x0066f160 · 237 bytes · __cdecl
_ZN12CEnvBeverage3UseEP11CBaseEntityS1_8USE_TYPEf
Decompiled
undefined (4 params)
/* CEnvBeverage::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */
void CEnvBeverage::Use(CBaseEntity *param_1)
{
CBaseEdict *this;
int iVar1;
int iVar2;
int iVar3;
if (param_1[0x440] != (CBaseEntity)0x0) {
return;
}
if (*(int *)(param_1 + 0x100) < 1) {
return;
}
iVar1 = CBaseEntity::Create("item_sodacan",(Vector *)(param_1 + 0x39c),(QAngle *)(param_1 + 0x3a8)
,param_1);
iVar3 = *(int *)(param_1 + 0x444);
if (iVar3 == 6) {
iVar3 = (**(code **)(*random_valve + 8))(random_valve,0,5);
if (iVar3 == *(int *)(iVar1 + 0x458)) goto LAB_0066f1e7;
}
else if (iVar3 == *(int *)(iVar1 + 0x458)) goto LAB_0066f1e7;
if (*(char *)(iVar1 + 0x6c) == '\0') {
this = *(CBaseEdict **)(iVar1 + 0x30);
if (this != (CBaseEdict *)0x0) {
*(uint *)this = *(uint *)this | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(this);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
*(byte *)(iVar1 + 0x70) = *(byte *)(iVar1 + 0x70) | 1;
}
*(int *)(iVar1 + 0x458) = iVar3;
LAB_0066f1e7:
iVar3 = *(int *)(param_1 + 0x100);
param_1[0x440] = (CBaseEntity)0x1;
(**(code **)(*(int *)param_1 + 0x214))(param_1,param_1 + 0x100);
*(int *)(param_1 + 0x100) = 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.