CBasePlayer::Weapon_Drop
0x007bfb40 · 264 bytes · __thiscall
_ZN11CBasePlayer11Weapon_DropEP17CBaseCombatWeaponPK6VectorS4_
Decompiled
undefined (4 params)
/* CBasePlayer::Weapon_Drop(CBaseCombatWeapon*, Vector const*, Vector const*) */
void __thiscall
CBasePlayer::Weapon_Drop
(CBasePlayer *this,CBaseCombatWeapon *param_1,Vector *param_2,Vector *param_3)
{
uint uVar1;
char cVar2;
CBaseCombatWeapon *pCVar3;
undefined *puVar4;
pCVar3 = (CBaseCombatWeapon *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
if (param_1 == (CBaseCombatWeapon *)0x0) {
CBaseCombatCharacter::Weapon_Drop
((CBaseCombatCharacter *)this,(CBaseCombatWeapon *)0x0,param_2,param_3);
if (pCVar3 != param_1) {
return;
}
}
else {
if (pCVar3 != param_1) {
CBaseCombatCharacter::Weapon_Drop((CBaseCombatCharacter *)this,param_1,param_2,param_3);
return;
}
(**(code **)(*(int *)param_1 + 0x3f0))(param_1,0xb7);
CBaseCombatCharacter::Weapon_Drop((CBaseCombatCharacter *)this,param_1,param_2,param_3);
}
cVar2 = CBaseCombatCharacter::SwitchToNextBestWeapon
((CBaseCombatCharacter *)this,(CBaseCombatWeapon *)0x0);
if ((((cVar2 == '\0') && (uVar1 = *(uint *)(this + 0x1f84), uVar1 != 0xffffffff)) &&
(puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar4 + 8) == uVar1 >> 0xc && (*(int **)(puVar4 + 4) != (int *)0x0)))) {
/* WARNING: Could not recover jumptable at 0x007bfc50. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(**(int **)(puVar4 + 4) + 0x3bc))();
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.