CTerrorPlayer::Weapon_Drop
0x009d6440 · 282 bytes · __thiscall
_ZN13CTerrorPlayer11Weapon_DropEP17CBaseCombatWeaponPK6VectorS4_
Decompiled
undefined (4 params)
/* CTerrorPlayer::Weapon_Drop(CBaseCombatWeapon*, Vector const*, Vector const*) */
void __thiscall
CTerrorPlayer::Weapon_Drop
(CTerrorPlayer *this,CBaseCombatWeapon *param_1,Vector *param_2,Vector *param_3)
{
code *pcVar1;
int *piVar2;
undefined4 uVar3;
int iVar4;
char *pcVar5;
CBasePlayer::Weapon_Drop((CBasePlayer *)this,param_1,param_2,param_3);
piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"weapon_drop",0,0);
if (piVar2 != (int *)0x0) {
pcVar1 = *(code **)(*piVar2 + 0x30);
uVar3 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
(*pcVar1)(piVar2,"userid",uVar3);
if (param_1 != (CBaseCombatWeapon *)0x0) {
pcVar5 = *(char **)(param_1 + 0x7c);
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
}
iVar4 = StringAfterPrefix(pcVar5,"weapon_");
if (iVar4 != 0) {
pcVar5 = pcVar5 + 7;
}
(**(code **)(*piVar2 + 0x3c))(piVar2,"item",pcVar5);
if (*(int *)(param_1 + 0x30) == 0) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar2 + 0x30))(piVar2,"propid",iVar4);
}
/* WARNING: Could not recover jumptable at 0x009d654c. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*gameeventmanager + 0x20))();
return;
}
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.